Hi,
Firstly, how do you do an xpath search on just an
element?
Jenny
Ynnej
1009
777 777
...
...
is the root element of the document.
So lets say you have the element with id =
"282" in an Element object, how do you perform an
xpath *relatve to just that element*.
p
> Firstly, how do you do an xpath search on just an
> element?
>
>
>
>Jenny
>Ynnej
>1009
>777 777
>
>
> ...
> ...
>
If you want to search relative to the Element, just leave out the
initial "/" (which means start with the document) and do something like:
personE
First off, your xml is invalid, you should send us what you are actually
using. But after fixing your example (some of the end tags have the "/"
at the end instead of something like "") you should do the
following:
Element person=people.selectNodes("//Person[@id='282']");
Element firstName= pe
BTW, you will need to cast the selectNodes to an element.
Element person=(Element)people.selectNodes("//Person[@id='282']");
Element firstName= person.element("FirstName");
--
++
| David Lucasmailto:[EMAIL PRO
And it would be wrong to use Nodes (it returns a List), use Node to
return only one.
Element person=(Element)people.selectNode("//Person[@id='282']");
Element firstName= person.element("FirstName");
What a morning...
--
++
| David Lu