Reading in Malformed XML (unencoded XML entities) with PHP -
I have some difficulty in parsing the faulty XML in PHP, in particular I ask a third party website which uses XML Returns data in an XML format without encoding it into actual data in the data. For example, in one of the elements ASCII's heart, '& lt; 3 ', without the quote, which the XML parser sees as an opening tag it' & amp; Lt; 3 'should be.
Right now I am simply passing an XML string in a simple XML, which inevitably fails in these examples. I have seen something and it seems that the PHP systematic package may be able to help me, but the configuration you can make is huge: (
So, I'm thinking if anyone And
thanks
Try:
Php> $ tidy = new tidy (); php> $ repaired = $ tidy-> repair string (" foo> I <3 Philadelphia " , Array ("input-xml"> & gt; 1)); php> print ($ repair); i & amp; amp; lt; 3 philadelphia & lt; / Foo & gt; php & gt; $ El = New Simple XML ($ repair);
Comments
Post a Comment