xsl-list
[Top] [All Lists]

Re: [xsl] Finding the path to a node

2007-05-11 06:19:28

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[(_at_)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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>