xml output question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toshesh
Forum Commoner
Posts: 33
Joined: Thu Jun 19, 2003 9:32 pm

xml output question

Post by toshesh »

whats wrong with my code? it displays everything in one line instead of the xml format.?? someone help? if this is to do with DOCTYPE then could someone tell me what that is exactly as well. thanks!!!!

echo "<?xml version='1.0'>";
echo "<dataSet>";
echo "<data>";
echo "<rownum>test</rownum>";
echo "<kid>blaa</kid>";
echo "<mname>bleee</mname>";
echo "<gtype>bloo</gtype>";
echo "</data>";
echo "</dataSet>";
User avatar
mofo
Forum Newbie
Posts: 3
Joined: Mon Jul 07, 2003 3:28 am
Location: Romania

Post by mofo »

echo "<?xml version='1.0'>";
echo "<dataSet>";
echo "<data>";
echo "<rownum>test</rownum>";
echo "<kid>blaa</kid>";
echo "<mname>bleee</mname>";
echo "<gtype>bloo</gtype>";
echo "</data>";
echo "</dataSet>";

Look at the first bold line. You are missing a ? before the closing >.

So instead of echo "<?xml version='1.0'>"; you should have
echo "<?xml version='1.0' ?>"; 8O
toshesh
Forum Commoner
Posts: 33
Joined: Thu Jun 19, 2003 9:32 pm

Post by toshesh »

oh yeah oops....

thanks!!!
Post Reply