Aravinthan Posted August 8, 2009 Share Posted August 8, 2009 Hi guys, I want to read a MYSQL data and then output it as a XML file.... Easy right? Well, I reduced the coding to this simplest thing: <?php header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; echo "<slide_show>"; echo "<photo>./images/DCP_0730.jpg</photo>"; echo "</slide_show>"; ?> But it still doesnt work. In Firefox I get: Quote XML Parsing Error: not well-formed Location: http://liguedhockeysimule.x10hosting.com/default.xml Line Number 7, Column 7: echo "<slide_show>"; ------^ In IE 8 I get: Quote The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- Invalid at the top level of the document. Error processing resource 'http://liguedhockeysimule.x10hosting.com/default.xml'.... echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; -------------------------------------------------^ I looked and looked, still cant seem to find the error.... I am pretty sure it is really a dumb mistake that I made somewher :oops: But I cant find it, I changed the code to single qutoes, back to to double.... But I guess I need to or something.... You can't imagine how stupid I feel lol Thanks for your help, Ara Link to comment https://forums.phpfreaks.com/topic/169377-dumb-question-for-xml-and-php/ Share on other sites More sharing options...
zq29 Posted August 8, 2009 Share Posted August 8, 2009 You have saved this as a php file, and are serving it through a webserver via PHP, right? The errors you have posted indicate that your script is not being interpreted by the PHP engine. The script you have posted works fine for me... Link to comment https://forums.phpfreaks.com/topic/169377-dumb-question-for-xml-and-php/#findComment-893815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.