This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: figuring out what grandparent(?) is
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 29 Mar 2002 21:32:37 -0000
- Subject: RE: [xsl] figuring out what grandparent(?) is
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> When processing the <link> template, I need to know whether
> I'm inside of
> the <smallbox> or just in the <article>; that is, I need
> something like:
>
> <xsl:choose>
> <xsl:when [descendant of smallbox]>
<xsl:when test="ancestor::smallbox">
tests whether the context node has an ancestor called <smallbox>.
Another approach is to write separate template rules for <link>s depending
on whether they are descendants of a smallbox:
<xsl:template match="link">...
<xsl:template match="smallbox//link">...
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list