|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
XPath - getting the parent of a node where attribute = x
Hello,
I have an XML document that consists of the same element type (called treeitem) embedded in itself representing a very genericized tree structure. That I'd like to do is use XPATH to search the entire document for a treeitem element with attribute id=int, where int is any number. I wrote the XPATH to grab the treeitem itself: //treeitem[@id=x] where x is an integer passed dynamically but now I can't see to get XPATH to give me the parent of that guy that I just grabbed. How can I accomplish this? -Cliff |
|
#2
|
|||
|
|||
|
..
So the id of the parent element would be ../@id, and all of the treeitem nodes in the current tree would be ..//treeitem. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XPath - getting the parent of a node where attribute = x |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|