Beasts Posted May 21, 2009 Share Posted May 21, 2009 hi, i am using simplexml to load data from an xml file. my php code is as follows : $xmldx = simplexml_load_string(file_get_contents('htmldata.xml')); $page = $xmldx->pages->home; echo($page); simplexml_load_file() doesn't work either... the xml is : <?xml version="1.0" encoding="ISO-8859-1"?> <pages> <home> asdasd <![CDATA[ <h1>THIS IS THE HOMEPAGE</h1> ]]> </home> </pages> my php settings are set to display all errors... this code gives no error and no output? Link to comment https://forums.phpfreaks.com/topic/159113-solved-no-error-and-no-output/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 What does a phpinfo() statement show for error_reporting and display_errors and what are you getting as output? A blank page? Does any other output on the page show up? Is your code inside of a conditional statement that is FALSE? Link to comment https://forums.phpfreaks.com/topic/159113-solved-no-error-and-no-output/#findComment-839113 Share on other sites More sharing options...
Beasts Posted May 21, 2009 Author Share Posted May 21, 2009 all error reporting works fine... all kinds of errors show... its inside the default: of a switch statement... so whatever the variable is this should produce output? output is NOTHING nothing in error logs either... Link to comment https://forums.phpfreaks.com/topic/159113-solved-no-error-and-no-output/#findComment-839126 Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 Use this (the pages tag is the document root tag and are not referenced to access the tags within it) - $page = $xmldx->home; Edit: It often helps to print out the xml object (at any level you are currently accessing it at) to see what it contains - echo "<pre>",print_r($xmldx,true),"</pre>"; Link to comment https://forums.phpfreaks.com/topic/159113-solved-no-error-and-no-output/#findComment-839133 Share on other sites More sharing options...
Beasts Posted May 21, 2009 Author Share Posted May 21, 2009 thankyou that worked Link to comment https://forums.phpfreaks.com/topic/159113-solved-no-error-and-no-output/#findComment-839203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.