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

XML Query

Status
Not open for further replies.

Eugenius

Programmer
Jul 12, 2007
2
US
I'm sure this is simple but I've been working on it all morning and can't get the right query so here it is

XML:
<vendorImport>
- <vendor name="tech" number="1">
<term>Tech</term>
<term>Techie</term>
</vendor>
- <vendor name="SD" number="2">
<term>Tech</term>
<term>SqD</term>
</vendor>
</vendorImport>

I want to populate a XPathExpression with the vandor name and number where term = 'Tech'

Thanks in advance
 
Thanks in advance
[small]Hmmm![/small]

Well, first, welcome to Tek-Tips.

There are a couple of ways to approach this. Here is an XPath expression that will return all the name attribute node(s) of all vendor element(s) having a child term element the value of which is 'Tech':
Code:
vendorImport/vendor[term='Tech']/@name
Does that help?

Tom Morrison
 
That is exactly what i was looking for.

Thanks a ton! This XML Query stuff is pretty cool but the syntax is something to be desired.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top