Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I am actually trying to retrieve data from a xml file in which i have already entered info. Actually i am creating a shopping cart. Here is the xml file
<?xml version="1.0"?>
<PRODUCTS>
<PRODUCT>
<IDNUM>001</IDNUM>
<SORT>Athlon XP</SORT>
<PRICE>599</PRICE>
<IMAGE><![CDATA[<IMG SRC="001.jpg">]]></IMAGE>
</PRODUCT>
<PRODUCT>
<IDNUM>002</IDNUM>
<SORT>Morgan</SORT>
<PRICE>203</PRICE>
<IMAGE><![CDATA[<IMG SRC="002.jpg">]]></IMAGE>
</PRODUCT>
</PRODUCT>
Now to retrieve info from the xml file i did the following piece of code,
<font face="arial" size=4><b>Product:</b></font><P> <span ID="SORT" DATASRC="#myProducts" DATAFLD="SORT"></span><input id="SORT" type=hidden DATASRC="#myProducts" DATAFLD="SORT"><P>
<font face="arial" size=4><b>Price:</b></font>$<span id="showPRICE" DATASRC="#myProducts" DATAFLD="PRICE"></span><input id="PRICE" type=hidden DATASRC="#myProducts" DATAFLD="PRICE"><P>
<INPUT TYPE=button VALUE="Add to cart" onClick="buyItem('','',1);">
Now this displays the first item, then how can retrieve the info for the second item. PLease help.
I am actually trying to retrieve data from a xml file in which i have already entered info. Actually i am creating a shopping cart. Here is the xml file
<?xml version="1.0"?>
<PRODUCTS>
<PRODUCT>
<IDNUM>001</IDNUM>
<SORT>Athlon XP</SORT>
<PRICE>599</PRICE>
<IMAGE><![CDATA[<IMG SRC="001.jpg">]]></IMAGE>
</PRODUCT>
<PRODUCT>
<IDNUM>002</IDNUM>
<SORT>Morgan</SORT>
<PRICE>203</PRICE>
<IMAGE><![CDATA[<IMG SRC="002.jpg">]]></IMAGE>
</PRODUCT>
</PRODUCT>
Now to retrieve info from the xml file i did the following piece of code,
<font face="arial" size=4><b>Product:</b></font><P> <span ID="SORT" DATASRC="#myProducts" DATAFLD="SORT"></span><input id="SORT" type=hidden DATASRC="#myProducts" DATAFLD="SORT"><P>
<font face="arial" size=4><b>Price:</b></font>$<span id="showPRICE" DATASRC="#myProducts" DATAFLD="PRICE"></span><input id="PRICE" type=hidden DATASRC="#myProducts" DATAFLD="PRICE"><P>
<INPUT TYPE=button VALUE="Add to cart" onClick="buyItem('','',1);">
Now this displays the first item, then how can retrieve the info for the second item. PLease help.