XML data islands: A useful mechanism to display Web form data
An XML data island is Extensible Markup Language embedded in an HTML document.Data islands are not that important or helpful at that time, but if it working correctly, they can be useful for storing client-side information.
This data island itself is useless when Embedded in an HTML document.In fact, unless you choose to view the page’s source, you don’t even know that the data island is there. The fact that the data island is hidden from the casual user can be of use. The data island can provide a method of storing information on the client’s machine in much the same way that hidden HTML frames do.The main difference between Data islands and hidden HTML frames is that data islands can be bound to HTML objects. And since they are XML, they can be manipulated on the client machine as any other XML document.
Let's take example of a shopping cart. Customers expect certain features from an e-commerce application, like the ability to view a shopping cart whenever the mood strikes. Having the necessary information on the client side allows the dynamic display of the shopping cart contents.
XML Data Embedded in HTML
An XML data island is XML data embedded into an HTML page.
Here is how it works; assume we have the following XML document
("employee.xml"):
Then, inside HTML document, you can embed the XML file above
with the <xml> tag. The id attribute of the <xml> tag defines an
ID for the data island, and the src attribute points to the XML
file to embed:
The datasrc attribute of the <table> tag binds the HTML table
element to the XML data island. The datasrc attribute refers to
the id attribute of the data island.
<td> tags cannot be bound to data, so we are using <span>
tags. The <span> tag allows the datafld attribute to refer to
the XML element to be displayed. In this case, it is datafld="ARTIST"
for the <ARTIST> element and datafld="TITLE" for the <TITLE>
element in the XML file. As the XML is read, additional rows are
created for each <CD> element.
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords: xml id, xml document, xml file, xml data island html page, xml data binding, html data island, html xml, data island xml