Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie to Xml. Please help

Status
Not open for further replies.

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=&quot;1.0&quot;?>
<PRODUCTS>
<PRODUCT>
<IDNUM>001</IDNUM>
<SORT>Athlon XP</SORT>
<PRICE>599</PRICE>
<IMAGE><![CDATA[<IMG SRC=&quot;001.jpg&quot;>]]></IMAGE>
</PRODUCT>
<PRODUCT>
<IDNUM>002</IDNUM>
<SORT>Morgan</SORT>
<PRICE>203</PRICE>
<IMAGE><![CDATA[<IMG SRC=&quot;002.jpg&quot;>]]></IMAGE>
</PRODUCT>
</PRODUCT>

Now to retrieve info from the xml file i did the following piece of code,

<font face=&quot;arial&quot; size=4><b>Product:</b></font><P> <span ID=&quot;SORT&quot; DATASRC=&quot;#myProducts&quot; DATAFLD=&quot;SORT&quot;></span><input id=&quot;SORT&quot; type=hidden DATASRC=&quot;#myProducts&quot; DATAFLD=&quot;SORT&quot;><P>

<font face=&quot;arial&quot; size=4><b>Price:</b></font>$<span id=&quot;showPRICE&quot; DATASRC=&quot;#myProducts&quot; DATAFLD=&quot;PRICE&quot;></span><input id=&quot;PRICE&quot; type=hidden DATASRC=&quot;#myProducts&quot; DATAFLD=&quot;PRICE&quot;><P>

<INPUT TYPE=button VALUE=&quot;Add to cart&quot; onClick=&quot;buyItem('','',1);&quot;>

Now this displays the first item, then how can retrieve the info for the second item. PLease help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top