Datasheet

This first example uses the XML tag to embed XML document data within an HTML page:
<HTML><BODY>
<XML ID=”xmlParts”>
<?xml version=”1.0” ?>
<parts>
<part>
<partnumber>X12334-125</partnumber>
<description>Oil Filter</description>
<quantity>$24.99</quantity>
</part>
<part>
<partnumber>X44562-001</partnumber>
<description>Brake Hose</description>
<quantity>$22.45</quantity>
</part>
<part>
<partnumber>Y00023-12A</partnumber>
<description>Transmission</description>
<quantity>$8000.00</quantity>
</part>
</parts>
</XML>
<TABLE DATASRC=#xmlParts>
<TR>
<TD><DIV DATAFLD=”partnumber”></DIV></TD>
<TD><DIV DATAFLD=”$text”></DIV></TD>
</TR>
</TABLE>
</BODY></HTML>
HTML and XML tags can have attributes or descriptive values. In the HTML code <IMG SRC=
”image.jpg” BORDER=”1”>
the tag is an <IMG> or image tag for referencing an image. The SRC
attribute tells the HTML <IMG> tag where to find the image, and the BORDER tag tells HTML to put a
“1” pixel wide border around the image.
The second example allows a reference to a separate XML file using the SRC attribute of the XML tag.
The XML source file is stored externally to the HTML page. In this case, the parts.xml file is stored in the
operating system and not stored within the HTML file as in the previous example:
<HTML><BODY>
<XML ID=”xmlParts” SRC=”parts.xml”></XML>
<TABLE DATASRC=#xmlParts>
<
TR><TD><DIV DATAFLD=”partnumber”></DIV></TD>
<TD><DIV DATAFLD=”$text”></DIV></TD>
</TR>
</TABLE>
</BODY></HTML>
8
Chapter 1
04_791202 ch01.qxp 10/6/06 10:59 AM Page 8