开发者

XML parsing _ dealing with an exception ... basic PHP problem

开发者 https://www.devze.com 2023-02-21 03:22 出处:网络
I have written a perfectly working XML parser using PHP... using, $xml = simplexml_load_file($newfile);

I have written a perfectly working XML parser using PHP... using,

$xml = simplexml_load_file($newfile);

Now, The newfile was a pointer to an xml file that has over 20000 lines.

The problem was, the system ( an android) started generating tags called

< none >

... when no value existed... BUT, there is NO < /none > tag ... There are multiple < none > values !! It seems like

a) Either instruct Android not to do this ! - TRIED, but it can't be controlled .. OS deals with it.

b) or, Create a PHP loophole to prev开发者_如何转开发ent this error !

I need help. How do I achieve this ?

Thanks


If there no end tag - xml is not valid. If there only issue with none tag you can try ignore it in your parser. Or even try remove none tags with php "find and replace" functions like preg_replace before dealing with parser

0

精彩评论

暂无评论...
验证码 换一张
取 消