I am creating XML in a PHP file from a MySQL database and just want the web page to look like raw XML or how do I open an XML file and make it look like XML?
I find a lot of tutorials on how to open an XML file and make it look nice through SAX, DOM, or XSL. I just want to create raw XML and find it nowhere on the web.
Can anyone help?
dmorison
8:42 pm on Mar 2, 2006 (gmt 0)
This is pretty much just down to sending the text/xml content-type header, a la:
<?php header("Content-Type: text/xml");
// dynamically generate and output your XML here ?>
brucec
8:59 pm on Mar 2, 2006 (gmt 0)
Thanks for the quick response. It works. I have been working well with XML and PHP for the last 3 years and have never had a need for that and it ironically turned out be the easiest line of code! Thanks.