Re: XML Parser misbehaves with &
| From: | Jeff Bearer | Date: | Mon, 18 Aug 2003 17:53:51 +0000 |
| Subject: | Re: XML Parser misbehaves with & | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159941@lists.php.net to get a copy of this message | ||
The data contains escaped ampersands -> &
Which is as far as I know the way one represents ampersands in their
data. In my post below, the value of $data the second time is "&"
because it has been evaluated by the xml parser.
And btw xmllint has no problems with &
On Mon, 2003-08-18 at 12:41, Justin Farnsworth wrote:
> This is normal. You have illegal XML there, as it should be
> in <![CDATA[ value ]]>. I have run across this, and have
> to clean it up with an awk script. Ampersand is a no-no.
>
> Just running xmllint on the file will tell you about the problem(s).
>
> _justin
>
> Jeff Bearer wrote:
> >
> > I've come across this frustrating behavior with the XML parser when it
> > reads an escaped ampersand (&)
> >
> > If the xml being evaluated is: <COLORS>Blue, Green & Red</COLORS>
> >
> > it calls the character data handler 3 times:
> > the first time the $data is "Blue, Green "
> > the second time is "&"
> > and the third time is " Red"
> >
> > Needless to say this is screwing up my parser, and the stuff I'm doing
> > won't make it easy to add this allowance. I'm hoping somebody can point
> > out a way to turn off this behavior. If this is the proper operation,
> > is it documented anywhere? I've been unable to find it.
> >
> > --
> > Jeff Bearer, RHCE
> > Webmaster, PittsburghLIVE.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com