By using Internet Explorer, unofficial <XML> tags can be used to create XML data islands.
Embed XML data in HTML
XML data island is the XML data embedded in HTML.
Here we will demonstrate how it works. Suppose we have the following XML document ("note. xml "):
<? XML version = "1.0" encoding = "ISO-8859-1" ?>
< Note >
< To > Tove </ To >
< From > Jani </ From >
< Heading > Reminder </ Heading >
< Body > Don't forget me this weekend! </ Body >
</ Note >
Then, in the HTML document, you can use the <XML> tag to embed the above XML file. <XML> the tag ID attribute defines the ID of the data island, And the src attribute points to the embedded XML file:
< Html >
< Body >
< XML ID = "NOTE" SRC = "Note. xml" > </ XML >
</ Body >
</ Html >
However, the embedded XML data is invisible to users.
The next step is to bind the data island to an HTML element to format and display the data.
Bind data island to HTML elements
In the following example, we embed an XML file named "cd_catalog.xml" into the HTML file.
View "cd_catalog.xml ".
This is an HTML file:
< Html >
< Body >
< XML ID = "Cdcat" SRC = "Cd_catalog.xml" > </ XML >
< Table Border = "1" Datasrc = "# Cdcat" >
< Tr >
< TD > < Span Dataworks = "Artist" > </ Span > </ TD >
< TD > < Span Dataworks = "Title" > </ Span > </ TD >
</ Tr >
</ Table >
</ Body >
</ Html >
Example:
<Table> the datasrc attribute of a tag can bind an HTML element to an XML data island. This datasrc attribute references the ID attribute of data island.
<TD> cannot be bound to data island, so we use the <span> label. <Span> allow the dataworks attribute to reference the XML elements to be displayed. In this example, dataworks = "artist" is used to reference the <artist> element in an XML file, while dataworks = "title" is used to reference the <title> element in an XML file. When the XML file is read, more rows are created for each <Cd>.
If the IE browser you are using is version 5.0 or later, you can test it yourself (tiy ).
Source: http://blog.zhongmoo.cn/post/141.html