RE: [xsl] numbering empty entities

Subject: RE: [xsl] numbering empty entities
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 6 Jul 2001 13:51:06 +0100
> 
> <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


Current Thread