This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Conditional selection of Templates in XSL
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Conditional selection of Templates in XSL
- From: "Pawson, David" <DPawson at rnib dot org dot uk>
- Date: Tue, 29 Aug 2000 14:31:04 +0100
- Reply-To: xsl-list at mulberrytech dot com
> My only question is how do I handle the <tr> and <td> contained
> within tables. I've tried something like..
>
>
> <xsl:template match="tr[not(ancestor::Table)]>
> <tr>
> <xsl:apply-templates/>
> </tr>
> </xsl:template>
>
> which I thought should select all the <tr> elements children of
> the context node that don't have table ancestors (i.e. are
> not nested).
> The same would apply for <td> elements.
> The XSL above doesn't work. It actually seems to work in
> reverse order
> i.e. it outputs <tr> for nested tables !!
If you want to *include* the higher level of tables,
and exclude the doubly nested ones, try the other axis
match="tr[not(descendant::Table)]>
HTH DaveP
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list