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

xpath and Map

Status
Not open for further replies.

asksam

Programmer
Joined
Sep 18, 2001
Messages
1
Location
US
Hi

Can some one help me on how to access the Map elements using Xpath. For example say i have the following XML(generated using XStream from java class),

<Request>
<id>AAA-001</id>
<testMap>
<entry>
<string>One</string>
<string>1</string>
</entry>
</testMap>
</Request>

if i want to access the value of the Map element 'One' what will be the xpath expression ?

does xpath supports Map?

Thanks in advance

Sam

 
"/Request/testMap/entry/string[1]"

Or...

"//entry/string[1]"

Or, if there is only 2 instances of string (as in the example)

"//string[1]"

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top