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

Get attribute value where attribute equals

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
How would I select an attribute in this scenario.

<Values>
<YearRow Year='1' Date = '2009/01/01' Amount = '1000.00'/>
<YearRow Year='2' Date = '2009/02/01' Amount = '2000.00'/>
<YearRow Year='2' Date = '2009/03/01' Amount = '3000.00'/>
</Values>

For example I want to select Date where Year = '2' using XPath.

Thanks in advance,

BK
 
Suppose the context node is the parent of Values, it is this.
[tt] Values/YearRow[@Year='2'][1]/@Date
Values/YearRow[@Year='2'][2]/@Date[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top