XPath locate help

Hi, I haven't worked with XPath enough to know this one off the top of my head.

Given this XML snippet
		<add key="clientID" value="7" />
                <add key="somethingelse" value="1234" />
		<add key="clientID" value="8" />
                <add key="somethingelse" value="5678" />

Open in new window

I need to be able to locate the "appSettings" block, on a per client basis, so my XPath will specify the clientID to look for.

This is my current flawwed and very non-working example,
//appSettings[add@value="7" and add@key="clientId"]

Can someone steer me in the correct direction?
LVL 33
Who is Participating?
zc2Connect With a Mentor Commented:
Try this:

//appSettings[add[@value="7" and @key="clientID"]]

Note, the string comparisons are case-sensitive.
raterusAuthor Commented:
Makes complete sense when I look at it, and it works great!

You're welcome
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.