blinkbob123
Technical User
Hi, i've just started learning xml. I've been using php (output in html) with a mysql database for years but thought i'd find out what the big deal was with xml. I read the xml tutorial over at w3schools.com but there's a couple things I can't understand.
Say I wish to do a search from the mysql database and put the results within tags in xml format. I try putting:
<?php
echo '
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Do not forget me this weekend!</body>
</note>
';
?>
in a file called test.php but although the source is correct (as you would expect) in your browser it doesn't display in the fancy way it would if the file extension was .xml (eg So how could I query the database using xml files to display it in the .xml format.
Also I've probably missed something on the tutorials but as I see it xml files use a style sheet (xslt file) which is calls and that parses the information in the xml file to display it in html. Say I wish to display the results of this page:
on my website in html. Then how would I go about doing this in php.
I'd appreciate if someone could help and I apologies if it may seem really simple but I've just go so used to mysql - php - html.
Say I wish to do a search from the mysql database and put the results within tags in xml format. I try putting:
<?php
echo '
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Do not forget me this weekend!</body>
</note>
';
?>
in a file called test.php but although the source is correct (as you would expect) in your browser it doesn't display in the fancy way it would if the file extension was .xml (eg So how could I query the database using xml files to display it in the .xml format.
Also I've probably missed something on the tutorials but as I see it xml files use a style sheet (xslt file) which is calls and that parses the information in the xml file to display it in html. Say I wish to display the results of this page:
on my website in html. Then how would I go about doing this in php.
I'd appreciate if someone could help and I apologies if it may seem really simple but I've just go so used to mysql - php - html.