OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Custom Chapter Numbering

Hi Ray,
Changing the chapter numbering is easier than eliminating it for the first chapter.  That's because often the word "Chapter" is added to the chapter number, and all those instances need to be handled if you eliminate it for one chapter.
Chapter numbers are generated by processing a chapter in mode="label.markup" (true of most element numbering as well).  Something like this would work to start on zero:
<xsl:template match="chapter" mode="label.markup">
  <xsl:value-of select="count(preceding::chapter)"/>
It just counts the number of preceding chapters.  The first one will have a count of zero.
The original template in this mode is in common/labels.xsl, and you will see that it is a bit more complex because it handles many options that come from parameter settings.  If you don't need to accomodate those variations, then this simple template would work.  Otherwise customize the original.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
----- Original Message -----
Sent: Sunday, July 23, 2006 1:37 PM
Subject: [docbook-apps] Custom Chapter Numbering

Docbook-5.0.b6 rng and xsl-1.70.1


Wish to either start chapter numbering at 0 or suppress first chapter numbering and start the second chapter at 1.


How can I accomplish this?



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]