LIS 525 - Binding XML data to an HTML table in Internet Explorer

Introduction

When viewed in Internet Explorer 5.0 or better, this page should show a table of terms and scope notes taken from a short thesaurus in XML format.

To make the display work correctly, some simplifications have been required to the original XML VocML file created by TheW32: (1) the <!DOCTYPE... line has been removed; (2) the <VocLoadFile> and </VocLoadFile> tags have been removed, because Internet Explorer expects the top-level tag to enclose directly a list of items to be included in the table; and (3) the SVHeader element has been removed, because only one type of element is allowed in the list.

On the HTML page, the essential source code reads as follows:

<xml id="ScVocab" src="525xbh.xml"></xml>

<table border=1 datasrc="#ScVocab">
<tr>
<td><span datafld="label"></span>
<td><span datafld="note"></span>
</table>
The value of the id attribute of the xml tag is arbitrary, but has to be matched by the value of the datasrc attribute of the table element. Each row in the table correponds to one item in the XML list. The datafld attribute of each span element in the table has to be the name of an element within the corresponding item; an element may be missing, in which case nothing is inserted in the display.

(XML binding does not work with lists.)

The XML-bound Table

For More Information


Home

Last updated April 20, 2007.
This page maintained by Prof. Tim Craven
E-mail (text/plain only): craven@uwo.ca
Faculty of Information and Media Studies
University of Western Ontario,
London, Ontario
Canada, N6A 5B7