Subject: Re: [xsl] xsl:number - What is Numbering Context? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 24 Apr 2002 17:09:31 -0400 |
Cheers, Wendell
I am trying to number figures consecutively through a document. I have a named template that handles generating the display text for figure captions. My intent is to re-use it for both the figure itself and cross references to figures:
<xsl:template name="figure-caption-text"> <xsl:text>Figure </xsl:text ><xsl:number count="Figure" level="any" /><xsl:text>. </xsl:text ><xsl:apply-templates/> </xsl:template>
When this template is called from the template for Figure/Caption, I get the expected correct numbering (Figure 1, Figure 2, etc.):
<xsl:template match="Figure/Caption"> <fo:block font-weight="bold"> <xsl:call-template name="figure-caption-text"/> </fo:block> </xsl:template>
However, when I call it for the cross ref, I always get the value "1":
<xsl:template match="Figure" mode="xref"> <xsl:apply-templates select="Caption" mode="xref"/> </xsl:template>
<xsl:template match="Figure/Caption" mode="xref"> <fo:inline font-style="italic"> <xsl:call-template name="figure-caption-text"/> </fo:inline> </xsl:template>
Clearly I'm missing something. I didn't see anything in the spec or the FAQ explained this behavior--everything implies that the numbering is with respect to the source tree, not, for example, the current node list as for position().
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl:number - What is Numb, Michael Kay | Thread | |
Re: [xsl] xsl:number - What is Numb, G. Ken Holman | Date | Re: [xsl] xsl:number - What is Numb, Wendell Piez |
Month |