Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting all ancestor elements

Status
Not open for further replies.

rmuller

Programmer
Nov 30, 2001
14
NL
i have a xml-document like:

<elem name=&quot;1&quot;>
<elem name=&quot;1.1&quot;>
<elem name=&quot;1.1.1&quot;>
...
etc.

Problem: the depth is NOT known.
I want a list with all ancestors of the 'deepest' elem-element.
Something like
ancestor::elem[descendant::elem[position()=last()]]
does not work????

thanks
Ronald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top