xmlrod Posted March 7, 2012 Share Posted March 7, 2012 How can i read this kind of xml document using simple xml.I have not seen such format and i need some clues on what to do. <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <?xml-stylesheet type="text/xsl" href="sms.xsl"?> <smses count="2"> <sms protocol="0" address="0800000" date="1328814938421" type="2" subject="null" body="Its raining cat and dogs;and their owners." toa="null" sc_toa="null" service_center="null" read="1" status="-1" locked="0" date_sent="null" readable_date="Feb 9, 2012 10:15:38 PM" contact_name="Hans Petit" /> <sms protocol="0" address="+2273839309" date="1329194575094" type="1" subject="null" body="Take it easi" toa="null" sc_toa="null" service_center="+4422500000" read="1" status="-1" locked="0" date_sent="null" readable_date="Feb 14, 2012 7:42:55 AM" contact_name="Miguel" /> </smses> Quote Link to comment https://forums.phpfreaks.com/topic/258440-clues-on-reading-this-xml-document-using-simplexml/ Share on other sites More sharing options...
requinix Posted March 7, 2012 Share Posted March 7, 2012 It's not using namespaces so there isn't that to worry about... You'd read it like you'd read any other XML file. Like, the first message's body is $xml->sms[0]["body"] Quote Link to comment https://forums.phpfreaks.com/topic/258440-clues-on-reading-this-xml-document-using-simplexml/#findComment-1324754 Share on other sites More sharing options...
xmlrod Posted March 7, 2012 Author Share Posted March 7, 2012 Thanks,that worked. Quote Link to comment https://forums.phpfreaks.com/topic/258440-clues-on-reading-this-xml-document-using-simplexml/#findComment-1324757 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.