August 4, 2009

0 Data Binding

Data Binding

XML Data Islands can be bound to HTML elements.

In the example below, an XML Data with an ID OF "cdcat" is loaded from tan extreme XML file ("cd_catalog.xml"). Next, the HTML table

element is bound to the Data Island with the datasrc attribute, and finally the td elements are bound to the XML data with a datafld attribute

inside a span element.

<html>
<body>

<xml id="cdcat" src="cd_catalog.xml"></xml>

<table border="1" datasrc="#cdcat">
<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
</tr>
</table>

</body>
</html>


Also try following tutorial, demonstrating <thead>, <tbody>, and <tfoot>.

<html>
<body>
<xml id="cdcat" src="cd_catalog.xml"></xml>
<table border="1" datasrc="#cdcat">
<thead>
<tr<th>Artist</th>Title</th></tr>
</thead>
<tfoot>
<tr><th colspan="2">This is my CD collection</th></tr>
</tfoot>
<tbody>
<tr>
<td><span datafld="artist"></span></td>
<td><span datafld="title"></span></td>
</tr>
</tbody>
</table>
</body>
</html>

0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger