larryg1964
Programmer
Playing around with fundamental XML Data Islands in simple HTML pages with the intent to link up an XML/RSS feed from a Forum to a lead in HTML page.
All worked as advertised, however, noticed a quirk with the very last data tag. As there are several other <link> tags but in lower nodes, it was not expected but for some reason the last higher level <link> tag is picking up the <starter><link> tag.
Looking for someone who can explain what is going on. The interesting thing is if the data tag is changed to say <anything> instead of <link>, it works fine so the IE 7.0 XML engine is not letting go of a previous tag's data OR maybe there is a limit on a given tag name. However, it would seem logical for it to be the last instance, but it is not.
Below is the code of the HTML file and a sample of the XML data. Any thoughts would be appreciated.
Thanks,
LarryG
HTML FILE (recentpost.html)
=========
<html><head><title>Test XML Databinding</title></head>
<body>
<xml id="rawdata" src="tpg_recent.xml"></xml>
<TABLE BORDER="1" datafld="recent-post" datasrc="#rawdata">
<TR><TD>Time: <SPAN DATAFLD="time"></SPAN></TD></TR>
<TR><TD>ID: <SPAN DATAFLD="id"></SPAN></TD></TR>
<TR><TD>Subject: <SPAN DATAFLD="subject"></SPAN></TD></TR>
<TR><TD>Body: <SPAN DATAFLD="body"></SPAN></TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="starter" datasrc="#rawdata">
<TR><TD> Starter Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Starter Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="poster" datasrc="#rawdata">
<TR><TD> Poster Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Poster Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="topic" datasrc="#rawdata">
<TR><TD> Topic Name: <SPAN DATAFLD="subject"></SPAN></TD></TR>
<TR><TD> Topic Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="board" datasrc="#rawdata">
<TR><TD> Board Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Board Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>Msg Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
<TR><TD> </TD></TR>
</TABLE>
</BODY>
</HTML>
XML DATA (tpg_recent.xml)
========
<?xml version="1.0" encoding="ISO-8859-1"?>
<smf:xml-feed xmlns:smf=" xmlns=" xml:lang="en-US">
<recent-post>
<time>April 07, 2007, 06:55:12 PM</time>
<id>1111</id>
<subject>
<![CDATA[Happy Easter]]>
</subject>
<body>
<![CDATA[I want to wish everyone a Happy Easter.]]>
</body>
<starter>
<name>
<![CDATA[richard]]>
</name>
<id>3</id>
<link> </starter>
<poster>
<name>
<![CDATA[richard]]>
</name>
<id>3</id>
<link> </poster>
<topic>
<subject>
<![CDATA[Happy Easter]]>
</subject>
<id>126</id>
<link> </topic>
<board>
<name>
<![CDATA[General Discussion]]>
</name>
<id>1</id>
<link> </board>
<link> </recent-post>
</smf:xml-feed>
All worked as advertised, however, noticed a quirk with the very last data tag. As there are several other <link> tags but in lower nodes, it was not expected but for some reason the last higher level <link> tag is picking up the <starter><link> tag.
Looking for someone who can explain what is going on. The interesting thing is if the data tag is changed to say <anything> instead of <link>, it works fine so the IE 7.0 XML engine is not letting go of a previous tag's data OR maybe there is a limit on a given tag name. However, it would seem logical for it to be the last instance, but it is not.
Below is the code of the HTML file and a sample of the XML data. Any thoughts would be appreciated.
Thanks,
LarryG
HTML FILE (recentpost.html)
=========
<html><head><title>Test XML Databinding</title></head>
<body>
<xml id="rawdata" src="tpg_recent.xml"></xml>
<TABLE BORDER="1" datafld="recent-post" datasrc="#rawdata">
<TR><TD>Time: <SPAN DATAFLD="time"></SPAN></TD></TR>
<TR><TD>ID: <SPAN DATAFLD="id"></SPAN></TD></TR>
<TR><TD>Subject: <SPAN DATAFLD="subject"></SPAN></TD></TR>
<TR><TD>Body: <SPAN DATAFLD="body"></SPAN></TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="starter" datasrc="#rawdata">
<TR><TD> Starter Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Starter Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="poster" datasrc="#rawdata">
<TR><TD> Poster Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Poster Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="topic" datasrc="#rawdata">
<TR><TD> Topic Name: <SPAN DATAFLD="subject"></SPAN></TD></TR>
<TR><TD> Topic Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE BORDER="1" datafld="board" datasrc="#rawdata">
<TR><TD> Board Name: <SPAN DATAFLD="name"></SPAN></TD></TR>
<TR><TD> Board Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
</TABLE>
</TD></TR>
<TR><TD>Msg Link: <SPAN DATAFLD="link"></SPAN></TD></TR>
<TR><TD> </TD></TR>
</TABLE>
</BODY>
</HTML>
XML DATA (tpg_recent.xml)
========
<?xml version="1.0" encoding="ISO-8859-1"?>
<smf:xml-feed xmlns:smf=" xmlns=" xml:lang="en-US">
<recent-post>
<time>April 07, 2007, 06:55:12 PM</time>
<id>1111</id>
<subject>
<![CDATA[Happy Easter]]>
</subject>
<body>
<![CDATA[I want to wish everyone a Happy Easter.]]>
</body>
<starter>
<name>
<![CDATA[richard]]>
</name>
<id>3</id>
<link> </starter>
<poster>
<name>
<![CDATA[richard]]>
</name>
<id>3</id>
<link> </poster>
<topic>
<subject>
<![CDATA[Happy Easter]]>
</subject>
<id>126</id>
<link> </topic>
<board>
<name>
<![CDATA[General Discussion]]>
</name>
<id>1</id>
<link> </board>
<link> </recent-post>
</smf:xml-feed>