Automatic numbering (2)

Příklad 4. Automatic multi-level numbering style

<xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">
    <xsl:template match="/book">
        <html>
            <body>
                <xsl:for-each select="chapter">
                    <h2>
                        <xsl:number count="chapter" format="1. "/>
                        <xsl:value-of select="title" />
                    </h2>
                    <xsl:for-each select="sect1">
                        <h3>
                            <xsl:number count="chapter" format="1. "/>
                            <xsl:number count="sect1" format="a. "/>
                            <xsl:value-of select="title" />
                        </h3>
                        <xsl:apply-templates select="para"/>
                    </xsl:for-each>
                </xsl:for-each>
            </body>
        </html>
    </xsl:template>
</xsl:styleshee