The Why and How of XML Data Islands - Showing the complete data
(Page 3 of 4 )
You may complete this picture by adding the other two DATAFLDs, namely student id and legacySkill, and your display would be as shown in the next picture. Some additional formatting has been added to make the display a little more jazzy. You may also notice that the data may be accessed in any order and need not follow the same one as in the original XML. If you choose not to show this data, you may leave them out as in Basic.htm.

Referencing an XML file on a web server
In Simple.htm the XML file was hard coded into the page. Instead of this you may also reference a file on the web server by referencing its "src" property as shown in the next snippet.
<xml DATASRC="WebStudents" src="http://localhost/webstudents.xml" ></xml>The source of the htm file, Basic2.htm with XML being referenced to a file saved on the web server, is shown in the next paragraph.
Basic 2.htm <HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<BODY>
<h3>Html file with embedded XML</h3>
<P>Here begins the XML Data Island</P>
<xml id="WebStudents" src="http://localhost/webstudents.xml"></xml>
<P>Here ends the XML Data Island</P>
<table DATASRC="#WebStudents" border="1" bgcolor="powderblue">
<tr>
<td><span DATAFLD="name"></td>
<td><span DATAFLD="id"></td>
<td><span DATAFLD="legacySkill"</td>
</tr>
</table>
</BODY>
</HTML>
Next: HTML tags that can be bound to an XML island >>
More XML Articles
More By Jayaram Krishnaswamy