J
Jamie Green
Using MSXML3.0, with the Dom SelectionLanguage set to Xpath I am
trying to query the following document
<Root>
<Child>Name</Child>
<Child>John</Child>
<Child>Smith</Child>
<Child>23</Child>
<Child>Name</Child>
<Child>Peter</Child>
<Child>Jones</Child>
<Child>Name</Child>
<Child>David</Child>
<Child>Brown</Child>
</Root>
I can retrieve the nodeset which contains nodes with the text Name
using the following query:
theRootNode.selectNodes("*[contains(text(),'Name')]")
How can I find all nodes that come one (or two) after a node that
contains the name text? i.e. I want all the first names (nodeset -
John, Peter, David) or all the surnames.
Note positional information will not work - note John Smith has an age
node and the others do not.
Any answers? Is this actually possible using Xpath?
trying to query the following document
<Root>
<Child>Name</Child>
<Child>John</Child>
<Child>Smith</Child>
<Child>23</Child>
<Child>Name</Child>
<Child>Peter</Child>
<Child>Jones</Child>
<Child>Name</Child>
<Child>David</Child>
<Child>Brown</Child>
</Root>
I can retrieve the nodeset which contains nodes with the text Name
using the following query:
theRootNode.selectNodes("*[contains(text(),'Name')]")
How can I find all nodes that come one (or two) after a node that
contains the name text? i.e. I want all the first names (nodeset -
John, Peter, David) or all the surnames.
Note positional information will not work - note John Smith has an age
node and the others do not.
Any answers? Is this actually possible using Xpath?