mikaint Posted July 25, 2009 Share Posted July 25, 2009 I'm using simplexml_load_file for handling a third party xml.... this usually works fine, but sometimes, for a reason i'm unable to discover, i'm getting some warnings and the script can't handle the data... WARNINGS: Warning: simplexml_load_file(): input conversion failed due to input error, bytes 0x9A 0x6B 0x6F 0x76 Warning: simplexml_load_file(): encoder error parser error : Premature end of data in tag match PART OF XML CODE <?xml version="1.0" encoding="windows-1253"?> <coupon couponTitle="23/7/2009"> <description>whatever</description> <match date="23/7/2009" time="01:30" homeTeam="Flamengo RJ" awayTeam="Barueri SP" championShip="Brazil - Serie A Brasileiro"> <status>4</status> <score>1-1</score> <halftime>0-0</halftime> <min>FIN</MIN> <info>"(goal) Baiano (pen) 53' | (goal) Emerson 69' | "</info> <goalnow>""</goalnow> <result>"X"</result> ...... </match> XML is using windows-1253, and probably that's the problem (just a guess), however this only happens a few times. Most of the time there's no problem. What could be the problem? Link to comment https://forums.phpfreaks.com/topic/167345-help-with-simplexml_load_file/ Share on other sites More sharing options...
jonsjava Posted July 25, 2009 Share Posted July 25, 2009 can you PM me the link to the XML file, so I can play with it, to help you figure out the issue? Link to comment https://forums.phpfreaks.com/topic/167345-help-with-simplexml_load_file/#findComment-882483 Share on other sites More sharing options...
jcrew Posted July 25, 2009 Share Posted July 25, 2009 <match date="23/7/2009" time="01:30" homeTeam="Flamengo RJ" awayTeam="Barueri SP" championShip="Brazil - Serie A Brasileiro"> Errr. Is that allowed in XML? Link to comment https://forums.phpfreaks.com/topic/167345-help-with-simplexml_load_file/#findComment-882485 Share on other sites More sharing options...
jonsjava Posted July 25, 2009 Share Posted July 25, 2009 you mean adding attributes? it's simple to parse: $xml = simplexml_load_file('your_file'); print_r($xml->your_value->attributes()); Link to comment https://forums.phpfreaks.com/topic/167345-help-with-simplexml_load_file/#findComment-882487 Share on other sites More sharing options...
jcrew Posted July 25, 2009 Share Posted July 25, 2009 you mean adding attributes? it's simple to parse: $xml = simplexml_load_file('your_file'); print_r($xml->your_value->attributes()); Oh. I've never seen that done before. Interesting. Link to comment https://forums.phpfreaks.com/topic/167345-help-with-simplexml_load_file/#findComment-882488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.