XPath Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    #1

    XPath Question

    Assuming the following XML:

    <poll>
    <title>Test Poll</title>
    <date>07/30/2003</date>
    <instructions>P lease respond to the following poll:</instructions>
    <questions>
    <question>
    <label>What is your choice?</label>
    <choices>
    <choice>Choic e 1</choice>
    <choice>Choic e 2</choice>
    <choice>Choic e 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?
Working...