This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: numbering empty entities
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] numbering empty entities
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 6 Jul 2001 13:51:06 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
>
> <xsl:template match="TABLE1/*[1]">
> <xsl:element name="TABLE1_LNR">
> <xsl:number count="TABLE1" level="single"/>
> </xsl:element>
> <xsl:copy>
> <xsl:apply-templates select="node()"/>
> </xsl:copy>
> </xsl:template>
> </xsl:stylesheet>
>
> The stylesheet doesn't add the number to the empty entity. The reason
> is, that the pattern "TABLE1/*[1]" doesn't match. But how can
> I resolve the task?
Just do:
<xsl:template match="TABLE1">
<TABLE1>
<TABLE1_LNR><xsl:number/></TABLE1_LNR>
<xsl:apply-templates/>
</TABLE1>
</xsl:template>
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list