Hi,
I have been trying to output XML with php but encountered a strange(!) error in Internet Explorer.
The expected xml output is this:(simplified)
<root>
<match_id>12</match_id>
<stadium_id>43</stadium_id>
<tribune_id>2</tribune_id>
<fan_id>453</fan_id>
</root>
I am producing this output with the following php code:
echo "<?xml version='1.0' encoding='utf-8' ?>
<root>
<match_id>"; echo $match->getId(); echo "</match_id>
<stadium_id>43</stadium_id>
<tribune_id>2</tribune_id>
<fan_id>".$_SESSION['user_id']."</fan_id>
</root>";
In firefox, the output is same as expected. However, in IE, the output is this:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<match_id>0</match_id>
<stadium_id>43</stadium_id>
<tribune_id>2</tribune_id>
<fan_id />
</root>
This is a really annoying error. I have set the php header for xml output, and changed lots of other things but could not make it work.
the $match->getId() part is just returning an integer but IE always shows this value as 0. If I set fan_id and match_id with hands in other words write it explicitly, ie shows the values correctly.
By the way, i am using this xml output in flash (as3) and this also shows the same result with IE.
What am i doing wrong?
any help is appreciated...