Joana
asked on
XSLT Position of Ancestor
Hello
I need to get the position of the ancestor when i am in a grand-child.
Say i am in <item2> within the <submenu>
I need to go a find the position of its <item1>
How do i do this?
<themenu>
<item>
<title>Home</title>
<link>www.xtra.co.nz</link>
</item>
<item1>
<title>Joana</title>
<link>www.xtra.co.nz</link>
</item1>
<item1>
<title>Craig</title>
<link>www.xtra.co.nz</link>
</item>
<item1>
<title subNo="Yes">Jim</title>
<link>www.xtra.co.nz</link>
<submenu>
<item2>
<title>Mic</title>
<link>www.xtra.co.nz</link>
</item2>
<item2>
<title>Grant</title>
<link>www.xtra.co.nz</link>
</item2>
<item2>
<title>Dave</title>
<link>www.xtra.co.nz</link>
</item2>
</submenu>
</item1>
<themenu>
I need to get the position of the ancestor when i am in a grand-child.
Say i am in <item2> within the <submenu>
I need to go a find the position of its <item1>
How do i do this?
<themenu>
<item>
<title>Home</title>
<link>www.xtra.co.nz</link>
</item>
<item1>
<title>Joana</title>
<link>www.xtra.co.nz</link>
</item1>
<item1>
<title>Craig</title>
<link>www.xtra.co.nz</link>
</item>
<item1>
<title subNo="Yes">Jim</title>
<link>www.xtra.co.nz</link>
<submenu>
<item2>
<title>Mic</title>
<link>www.xtra.co.nz</link>
</item2>
<item2>
<title>Grant</title>
<link>www.xtra.co.nz</link>
</item2>
<item2>
<title>Dave</title>
<link>www.xtra.co.nz</link>
</item2>
</submenu>
</item1>
<themenu>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for taking so long, forgot i hadn't changed my email address fo new job. Thanks heaps for the answer it was just what i was looking for.
Gasper