XML Integration with ADO and Internet Explorer 5 - IE Data Islands and Binding
(Page 7 of 8 )
We have already seen a few examples of XML data islands and how to bind HTML elements to them in the previous tutorials. Let us take a look at it once again, since we’re going to be learning about data binding in detail today. We can create a data island with <XML> tag in an HTML page.
<xml ID= “diData” SRC = “BookAuthors.xml”></xml>
This references an external XML file as the source of the data. Alternatively, We can even embed the XML data within a <XML> tag.
<XML id=“diData” <BookAuthors>
<Author>
<au_id>1001</au_id>
<au_lname> Gates </au_name>
<au_fname> Bill </au_name>
</Author>
</BookAuthors>
</XML>
There are two forms of data binding. The first option is to bind single element, like so:
<INPUT dataFld=“emp_id”
dataSrc=“#diData” type=“TEXT”> </INPUT>
This binds a single element to a field in the data source. An alternative method would be to use table for binding. Here we bind a table to the data source, and then elements in the table to the data field:
<TABLE dataSrc=“#diData”>
<TBODY>
<TR>
<TD><INPUT dataFld=“emp_id” type=“TEXT”></INPUT></TD>
<TD><INPUT dataFld=“emp_fname”
type=“TEXT”></INPUT></TD></TR></TBODY></TABLE>
The Table would give the following result when DataBinding.html is loaded in IE.
Next: Binding Hierarchical Data >>
More XML Articles
More By Gayathri Gokul