C
Chris
Assuming the following XML:
<poll>
<title>Test Poll</title>
<date>07/30/2003</date>
<instructions>Please respond to the following poll:</instructions>
<questions>
<question>
<label>What is your choice?</label>
<choices>
<choice>Choice 1</choice>
<choice>Choice 2</choice>
<choice>Choice 3</choice>
</choices>
</question>
</questions>
</poll>
.... I'd like to use XPath to find the "choice" element that has a
particular value, for example "Choice 2."
What is the syntax? I thought it would be something like:
//choices[choice='Choice 2']/choice
.... but that doesn't seem to do the trick. Any ideas?
<poll>
<title>Test Poll</title>
<date>07/30/2003</date>
<instructions>Please respond to the following poll:</instructions>
<questions>
<question>
<label>What is your choice?</label>
<choices>
<choice>Choice 1</choice>
<choice>Choice 2</choice>
<choice>Choice 3</choice>
</choices>
</question>
</questions>
</poll>
.... I'd like to use XPath to find the "choice" element that has a
particular value, for example "Choice 2."
What is the syntax? I thought it would be something like:
//choices[choice='Choice 2']/choice
.... but that doesn't seem to do the trick. Any ideas?