This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: figuring out what grandparent(?) is


>
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]