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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting xml element attribute

Status
Not open for further replies.

gyan

IS-IT--Management
Jul 8, 2001
18
US
Hi,

Refering to XML parser tutorial at how do we extract the attribute value.

e.g;

The XML file:
-------------
<?xml version=&quot;1.0&quot;?>
<machine>
<component id=&quot;1&quot;>
<title>Sound Card</title>
<price>Rs. 700.00</price>
<madein href=&quot; </component>
</machine>

We would like to extract the value of href and link it with 'India', so that, if user clicks on India, it goes to

Thanks,

Gyan
 
The problem is that xpat is event-driven. There is no statefulness to be able to associate &quot;India&quot; with the href unless you implement it.

You might find this tutorial link helpful:
This tutorial and sample code puts the xml data into an array of objects.

______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top