Re: simplexml choking on apparently valid XML

From: Date: Sat, 08 May 2010 11:18:26 +0000
Subject: Re: simplexml choking on apparently valid XML
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-305010@lists.php.net to get a copy of this message
& - & amp; added space because browser is converting it to & :) On 5/8/10, Deva <devendra.in@gmail.com> wrote: > I think that "&" should be &amp; because you cant use "&" in > xml as > independent alphbet > > On 5/7/10, Dan Joseph <dmjoseph@gmail.com> wrote: >> On Thu, May 6, 2010 at 8:02 PM, Brian Dunning >> <brian@briandunning.com>wrote: >> >>> Hey all - >>> >>> I'm using simplexml-load-string just to validation a string of XML, and >>> libxml-get-errors to return any errors. It's always worked before, but >>> today >>> it's choking on this line in the XML: >>> >>> <client_orderitem_number>Basketball Personalized Notebook - >>> Jeff&apos;s</client_orderitem_number> >>> >>> It's returning "Premature end of data in tag client_orderitem_number >>> line >>> 90" but as far as I can tell, Jeff&apos;s is properly XML encoded. I >>> can't >>> debug this. Any suggestions? >>> >>> I have run the XML through a couple of online validators and it does >>> come >>> back as valid with no errors found. >>> <http://www.php.net/unsub.php> >>> >>> >> I had this problem.... It turned out to be some special characters in >> the >> tags or data that I had to strip out first, then load it thru the >> simplexml >> parser. I will have to check my code when I get back to the office in >> the >> AM and I'll let you know what it was if you haven't figured it out by >> then. >> But that might get you started in fixing it. >> >> -- >> -Dan Joseph >> >> www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. >> Promo >> Code "NEWTHINGS" for 10% off initial order >> >> http://www.facebook.com/canishosting >> http://www.facebook.com/originalpoetry >> > > -- > Sent from my mobile device > > Devendra Jadhav > देवेंद्र जाधव > -- Sent from my mobile device Devendra Jadhav देवेंद्र जाधव

« previous php.general (#305010) next »