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]

RE: Conditional selection of Templates in XSL



> 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

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