For some reason, xsl:number in Xalan-C++ 1.1 (on Windows - haven't tried
this on another platform) seems to have problem reporting correcting
consisently.

Example:

The XML:
  <text>
    <body>
      <chapter id="b1b1b4b4b2">

      <figure fileName="smile" type="png"/>
      
      </chapter></body></text>

The XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="text"/>

<xsl:template match="chapter">
        Chapter <xsl:number count="//chapter"/>
        <xsl:apply-templates/>
</xsl:template>

<xsl:template match="figure">
        Figure <xsl:number level="any" count="//chapter"/>.<xsl:number
level="any" from="chapter" count="//figure[not(@numbered='no') or
not(@numbered)]"/>

</xsl:template>
</xsl:stylesheet>

The output, with Xalan (using TestXSLT) and Saxon (which gives the correct
result).
H:\lit_xslt\test>TestXSLT -q -in example.xml -xsl number.xsl

        Chapter 1
        Figure 3.1
H:\lit_xslt\test>saxon example.xml number.xsl



        Chapter 1


        Figure 1.1

Thanks,
MIke


Reply via email to