Datasheet
2. Begin by creating the <HTML> tags for the start and end of the HTML page:
<HTML>
</HTML>
3. You could add a <HEAD> tag, allowing inclusion of a title into the browser. Begin by creating the
<HTML> tags for the start and end of the HTML page:
<HTML>
<HEAD><TITLE>Regions and Countries</TITLE></HEAD>
</HTML>
4. Add the body section for the HTML page by enclosing it between the <BODY> tags:
<HTML>
<HEAD><TITLE>Regions and Countries</TITLE></HEAD>
<BODY>
</BODY>
</HTML>
5. Now add the <XML> tag into the body of the HTML page, which references the externally stored
XML document:
<HTML>
<HEAD><TITLE>Regions and Countries</TITLE></HEAD>
<BODY>
<XML ID=”xmlCountries” SRC=”countries.xml”></XML>
</BODY>
</HTML>
6. Add a table field (<TABLE> tag) to the HTML page. The table field references the <XML> tag,
by the
ID attribute, as shown in the code that follows. The SRC in the <XML> tag allows direct
access from the HTML page to XML tags as stored in the countries.xml file. In other words, the
countries.xml file is referenced from the HTML page as a referenced data island:
<HTML>
<HEAD><TITLE>Regions and Countries</TITLE></HEAD>
<BODY>
<XML ID=”xmlCountries” SRC=”countries.xml”></XML>
<TABLE DATASRC=#xmlCountries>
<TR>
<TD><DIV DATAFLD=”region”></DIV></TD>
<TD><DIV DATAFLD=”$text”></DIV></TD>
</TR>
</TABLE>
</BODY>
</HTML>
7. The result will look as shown in Figure 1-6, when executed in a browser.
10
Chapter 1
04_791202 ch01.qxp 10/6/06 10:59 AM Page 10