Subject: Re: Finding the path to a node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 11 May 2007 14:19:14 +0100
|
> I have a new one: I have to find the "root"-node of a node
> (not the document root, but a certain root).
you don't say what you mean by this so its hard to give explict code or advice.
> A list of nodes 1,2,3 is acceptable, too.
that's more or less what your posted code does
//page[@id='4']/ancestor:node()"
is the sequence (or set in XSLT 1) of 4 nodes
<pages> <page id="1"> <page id="2"> <page id="4">
in what way is this not what you need?
Perhaps you just want the id of the outermost page ancestor of the
current node which is
<xsl:value-of select="ancestor::page[last()]/@id"/>
but that's just a guess.
David
________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________
|