Re: [xsl] Display count function output as letter value instead of number value

Subject: Re: [xsl] Display count function output as letter value instead of number value
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 19 Aug 2008 16:50:01 +0200
Sharon_Harris@xxxxxxxxxxxxxxxxxxxx wrote:
xsl:number does not output the numbering correctly. I have tried various
ways of using xsl:number and though I can get a letter to output instead of
a number, the sequence is wrong.

Your original post had


<xsl:template match="//SelfStudy" mode="toc">
            <fo:block xsl:use-attribute-sets="TOC1">
                  <xsl:text>Self Study&#160;</xsl:text>
                              <xsl:value-of select="
count(preceding::SelfStudy)+1"/>

so assuming you want to format that count value then I think you simply need

<xsl:template match="//SelfStudy" mode="toc">
            <fo:block xsl:use-attribute-sets="TOC1">
                  <xsl:text>Self Study&#160;</xsl:text>
                  <xsl:format-number value="
count(preceding::SelfStudy)+1" format="A"/>


There might be more elegant solutions using the other attributes of format-number but I have not looked at details of the structure of your XML.



--


	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread