xsl-list
[Top] [All Lists]

Re: Selecting all ancestors

2002-10-15 13:40:32
Juan Carlos Gonzalez wrote:
Hi:
Based on the following tree, I want to select all the
parents for an specific catid. I.e for catid="3" I
should select id's 1 and 2. This tree coul have
different levels.

Use the ancestor axis:
  http://www.w3.org/TR/xpath#axes
Something like
 <xsl:template match="cat[id=3]"> <!-- or whatever -->
  <xsl:apply-templates select="ancestor::*"/>
  ...

J.Pietschmann


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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