Echoing xml in PHP gives blank pages in Browser



I have a similar question to this: http://ift.tt/1mjvUjI


I don't see my xml in my browser, but just a blank page. I only checked Chrome and firefox, but it's happening in both. The difference is that I'm getting data from MySQL and echoing it. So the file extension is .php and not .xml



$row = mysqli_fetch_assoc($resource);
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<video>\n";
echo "<path>" . $row['path'] . "</path>\n";
echo "</video>\n";


I see a blank page when I go to the url. But when I "View Source", I see the xml tree.



<video>
<path>URLtoVideo.mp4</path>
</video>


My main goal is to grab the xml data and request it in Flash using URLRequest(). But I get this error



TypeError: Error #1088: The markup in the document following the root element must be well-formed.


I think this may be the problem to the error I get in Flash. I only have one root node, and I don't think I have any problems with the child nodes. So my only assumption is that the error occurs because of the blank page.


No comments:

Post a Comment