Displaying Information in table using DOM

webmasterbeta

New Member
Dear guys,

I am trying to Write an HTML file to displays the content of products.xml in a table using the DOM instead of using data binding method that i have done but I duno how. pLs refer to my codings below:
_________________________________________________________________
Products.xml
<products>
<product>
<product_id>01</product_id>
<description>Product A</description>
<unit_price>14.92</unit_price>
</product>
<product>
<product_id>02</product_id>
<description>Product B</description>
<unit_price>11.92</unit_price>
</product>
<product>
<product_id>03</product_id>
<description>Product C</description>
<unit_price>9.54</unit_price>
</product>
Displaying using Data Binding
<HTML>
<HEAD>
<TITLE>XML Data Binding Example</TITLE>
</HEAD>
<BODY>
<DIV ALIGN=CENTER>
<P>The following table is bound to the products.xml document.</P>
<H2>Product Inventory</H2>

<XML ID="XMLproducts" SRC=http://www.webdeveloper.com/forum/archive/index.php/"products.xml"></XML>
<TABLE BORDER="1" DATASRC="#XMLproducts">
<THEAD>
<TR> <TH>Product ID</TH> <TH>Description</TH> <TH>Unit Price</TH>
</TR>
</THEAD>
<TR>
<TD><SPAN DATAFLD="product_id"></SPAN></TD>
<TD><SPAN DATAFLD="description"></SPAN></TD>
<TD><SPAN DATAFLD="unit_price"></SPAN></TD>
</TR>
</TABLE> </DIV> </BODY> </HTML>
 
Back
Top