Re: [PHP] simplexml choking on apparently valid XML - Solved
I was able to resolve this by changing the XML file encoding from UTF-8 to ISO-8859-1. Works like a charm now, with the XML-encoded characters. Thanks to all who offered their help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: 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_numberBasketball Personalized Notebook - Jeffapos;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, Jeffapos;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 देवेंद्र जाधव -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
- amp; added space because browser is converting it to :) On 5/8/10, Deva devendra...@gmail.com wrote: I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: 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_numberBasketball Personalized Notebook - Jeffapos;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, Jeffapos;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 देवेंद्र जाधव -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
On 8 May 2010 00:39, Nathan Nobbe quickshif...@gmail.com wrote: hmm, both the strings seem to work fine on my laptop: +1. Have no problem with either string -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
This time simplexml-load-string also gave me the same error on the following line: first_nameCharlie amp; Brady/first_name Can anyone confirm whether simplexml-load-string will or will not accept or allow XML-encoded characters? It seems that it should and would be pretty surprising if it wouldn't. On May 6, 2010, at 5:02 PM, Brian Dunning 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_numberBasketball Personalized Notebook - Jeffapos;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, Jeffapos;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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
On Fri, May 7, 2010 at 4:32 PM, Brian Dunning br...@briandunning.comwrote: This time simplexml-load-string also gave me the same error on the following line: first_nameCharlie amp; Brady/first_name Can anyone confirm whether simplexml-load-string will or will not accept or allow XML-encoded characters? It seems that it should and would be pretty surprising if it wouldn't. hmm, both the strings seem to work fine on my laptop: php var_dump(simplexml_load_string('first_nameCharlie amp; Brady/first_name')); object(SimpleXMLElement)#1 (1) { [0]= string(15) Charlie Brady } php var_dump(simplexml_load_string('client_orderitem_numberBasketball Personalized Notebook - Jeffapos;s/client_orderitem_number')); object(SimpleXMLElement)#1 (1) { [0]= string(41) Basketball Personalized Notebook - Jeff's } -nathan
Re: [PHP] simplexml choking on apparently valid XML
On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: 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_numberBasketball Personalized Notebook - Jeffapos;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, Jeffapos;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