pagegen Posted August 6, 2010 Share Posted August 6, 2010 <category id="SOCMENEURASTVICLEA" order="26800">Aus. Victoria League</category> I have the above xml, I can read the category id, order but I dont no how to read the value "Aus. Victoria League" foreach($description->children() as $category) { foreach($category->attributes() as $a => $b) { echo "<br/> -------- "; echo $a,'="',$b,"\"\n"; } echo "category name" . $category->asXML(); } the asXML() i have no idea what that is but am guessing I need thats where the php function which returns the value needs to go Thank you Quote Link to comment https://forums.phpfreaks.com/topic/209968-xml-value-not-reading/ Share on other sites More sharing options...
pagegen Posted August 6, 2010 Author Share Posted August 6, 2010 any website which shows a list of @simplexml_load_string function will help too guys Quote Link to comment https://forums.phpfreaks.com/topic/209968-xml-value-not-reading/#findComment-1095946 Share on other sites More sharing options...
Adam Posted August 6, 2010 Share Posted August 6, 2010 asXML() simply returns the element in it's XML form. Try: echo "category name" . $category->category; Quote Link to comment https://forums.phpfreaks.com/topic/209968-xml-value-not-reading/#findComment-1095990 Share on other sites More sharing options...
PradeepKr Posted August 8, 2010 Share Posted August 8, 2010 Apart from MrAdam's suggestion, you should take care of time out in case the XML file is remote (not in your home directory). Check http://www.expertsguide.info/2010/08/set-time-out-while-downloading-files/ for various methods on implementing timeout. A very similar query post, I responded to, is here http://www.phpbuilder.com/board/showthread.php?t=10374858 Quote Link to comment https://forums.phpfreaks.com/topic/209968-xml-value-not-reading/#findComment-1096529 Share on other sites More sharing options...
Adam Posted August 8, 2010 Share Posted August 8, 2010 Not really sure how that relates to the problem at hand? Would have to be a very large XML file for the server to struggle with timeout issues. Quote Link to comment https://forums.phpfreaks.com/topic/209968-xml-value-not-reading/#findComment-1096735 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.