Hi,
I am trying to convert an xml file.
Not by parsing- but by reading in 1 line at a time
and removing the leading and trailing spaces.
I'm not trying to remove spaces within the tags:
i.e.
<para>This text can have spaces, so it is okay</para>
what i am trying to resolve is a ton of extra whitespace
inbetween a closing tag for an element
and the opening tag of the next element... as in
</A.OPTION>
</A.OPTIONS>
</QUESTION>
</Q.GROUP>
you see, how the tags are all over the place?
In Perl, the lines of code to do a substitution that
were working for me was
s/^\s+//g; # Trim leading whitespace
s/\s+$//g; # Trim trailing whitespace
But, the few things i have tried in PHP that are similar
are not accomplishing the same thing.
I have tried eregi_replace()
and have tried preg_replace()
Am i missing something??
Can anyone help?
Thanks-
Adam