News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

Bind the Data Island to <span> or <div> Elements

Started by ben2ong2, October 06, 2006, 04:10:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ben2ong2

<span> or <div> elements can be used to display XML data.
You don't have to use the HTML table element to display XML data. Data from a Data Island can be displayed anywhere on an HTML page.
All you have to do is to add some <span> or <div> elements to your page. Use the datasrc attribute to bind the elements to the Data Island, and the datafld attribute to bind each element to an XML element, like this:

Title:<span datasrc="#xmldso" datafld="TITLE"></span>
Artist:<span datasrc="#xmldso" datafld="ARTIST"></span>
Year:<span datasrc="#xmldso" datafld="YEAR"></span>
or like this:

Title:<div datasrc="#xmldso" datafld="TITLE"></div>
Artist:<div datasrc="#xmldso" datafld="ARTIST"></div>
Year:<div datasrc="#xmldso" datafld="YEAR"></div>
If you have IE 5.0 or higher: See how the XML data is displayed inside the HTML elements.
Note that if you use an HTML <div> element, the data will be displayed on a new line.
With the examples above, you will only see one line of your XML data. To navigate to the next line of data, you have to add some scripting to your code.

You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login