This article explains a useful way to embed data in an HTML document, and store it on the client, using XML. With XML becoming ever more pervasive and the client side implementation gaining a lot of ground, you will probably find yourself using this technique in many projects.
The Why and How of XML Data Islands - Getting the names of students (Page 2 of 4 )
It was mentioned that the XML data island represents the built-in Data Source Object DATASRC, which is identified by the id property. Associated with the data source are its fields, which are identified by the DATAFLD property. For example, the student "Linda Jones" will fit in as a DATAFLD. Let's add the following HTML code to this file:
and call the new file Basic.htm, whose source is shown in the next paragraph:
<h3>Html file with embedded XML</h3>
<P>Here begins the XML Data Island</P>
<!-- My students who attended my web programming class -->
<P>Here ends the XML Data Island</P> <table DATASRC="#WebStudents">
In the above added snippet, you have identified the DATASRC as "#WebStudents" and out of the three elements, student id, name, and legacySkill you have opted to show only the "name." Now if you browse the file Basic.htm, your display will appear as shown in the next picture. Although you have only a single <td/> element, you have all the rows of data.