HTML and CSS Reference
In-Depth Information
Linking an XML document to an HTML Web page requires the use of the HTML
element <xml> to create a data island. The <xml> tag also works only in Internet Explorer.
A unique name represents the data island in the XML element, called a data source
object ( dso ). Table 12-30 shows the general form of the <xml> element. Because the
<xml> tag is unique to Internet Explorer, this HTML Web page will not validate properly
from the w3.org validation page.
Data Binding
Data binding consists of
four major pieces: the data
source object (DSO), data
consumers, the binding
agent, and the table
repetition agent.
Table 12-30 General Form of the HTML <xml> Element
General form:
<xml id="name" src="URL"></xml>
Comment:
The <xml> element is a Microsoft extension and may not be recognized by browsers other than
Internet Explorer. The id attribute value, name , must be a unique name, and it must represent the
data source. Web developers use the prefix dso before any name value to indicate that it is the
data source object. The URL is the location and name of the XML data file. The <xml> element
must have an end element.
Example:
<xml id="dsoTableList" src="chapter12-1product_id.xml"></xml>
When the browser opens the HTML Web page, the XML parser reads and parses
the XML data. The browser then creates a data island or data source object (dso), which
handles and manipulates the XML data as a recordset. A recordset is a collection of data
records and their fields. The Internet Explorer browser also contains several built-in
methods, properties, and events that are automatically associated with the recordset.
The <xml> Tag
and Validation
The <xml> tag is unique
to Internet Explorer.
This tag is what links or
binds an XML document
to the Web page. This
tag is not recognized by
other browsers, so when
validating the HTML
pages, this tag will be
identified as invalid.
To Create an HTML Document to Display XML Data in a Table
The following steps create the HTML document to display the XML data in
a table.
1
Activate the open Notepad++ window.
2
With a USB drive plugged into your computer, open the file chapter12-1table.html from
the Chapter12\ChapterFiles folder.
3
Click File on the menu bar, and then click Save As.
4
Type chapter12-1table_solution.html in the File name text box.
5
Click the Save button in the Save As dialog box to save the file with a new name
(Figure 12-30).
new filename
displays in tab
Figure 12-30
 
Search WWH ::




Custom Search