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: apply templates to the nth record and above?


> Here's what I got, it only does record 2, but I need record 2 
> and above.
> 
> <xsl:apply-templates select="AREA[2] | following-sibling::AREA"
> mode="within"/>

you could do AREA[2] | AREA[2]/following-sibling::AREA

but writing AREA[position >= 2] is simpler.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 
> 
> 
> If anyones interested, heres what Im working on, perhaps 
> there is a better
> way? Its an XSL to create a multiple row HTML table where the 
> first row may
> be extended with rowspan.
> 
> 
> <xsl:template match="CONTACTS/CONTACT">
> 
> 	<TR valign="top">
> 		<TD>
> 		<xsl:attribute name="rowspan"><xsl:value-of
> select="count(AREA)" /></xsl:attribute>
> 		<xsl:value-of select="COUNTRY" 
> /></TD><xsl:apply-templates
> select="AREA[1]" />
> 	</TR>
> 
> 	<xsl:apply-templates select="AREA[2] | following-sibling::AREA"
> mode="within"/>
> 
> </xsl:template>
> 
> <xsl:template match="AREA">
> 
> 	<TD><xsl:apply-templates /></TD><TD><xsl:value-of 
> select="@phone"
> /></TD>
> </xsl:template>
> 
> <xsl:template match="AREA" mode="within">
> 
> 	<TR>
> 		<TD><xsl:apply-templates /></TD><TD><xsl:value-of
> select="@phone" /></TD>
> 	</TR>
> </xsl:template>
> 
> 
> 
> 
> Thanks
> 
> Lea
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 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]