Next in thread → Next in month →

Re: DOCBOOK: Help - Reseting the chapter numbering

From
@orman Valsh
Date
2000-10-11T21:06:10+00:00
ID
Thread
Re: DOCBOOK: Help - Reseting the chapter numbering
[Follow-ups to docbook-apps, please.]

/ St廧hane Bline <> was heard to say:
| I had a look at the stylesheets but could not spot the XSL construct that
| would allow me to do that.
| Can anybody help ?

Redefine the template that numbers chapters. This will do what you want:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<xsl:import href="../html/docbook.xsl"/>

<xsl:template match="chapter" mode="label.content">
  <xsl:param name="punct">.</xsl:param>
  <xsl:choose>
    <xsl:when test="@label">
      <xsl:value-of select="@label"/>
      <xsl:value-of select="$punct"/>
    </xsl:when>
    <xsl:when test="$chapter.autolabel != 0">
      <xsl:number from="book|part" count="chapter" format="1" level="any"/>
      <xsl:value-of select="$punct"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <>      | He that overvalues himself will
http://www.oasis-open.org/docbook/ | undervalue others, and he that
Chair, DocBook Technical Committee | undervalues others will oppress
                                   | them.--Dr. Johnson
Next in thread → Next in month →