[moving this over to the docbook-apps mailing list where stylesheet issues are discussed]

Yes, this can be done with a small customization:

<xsl:param name="start.numbering.at" select="0"/>

<xsl:template match="section" mode="label.markup">
 <xsl:choose>
   <xsl:when test="$start.numbering.at != 0 and not(ancestor::section)">
     <xsl:value-of select="$start.numbering.at"/>
   </xsl:when>
   <xsl:otherwise>
     <xsl:apply-imports/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

The 'label.markup' mode is used to generate a number for an element. In this case, it only applies to top level sections. Or you could test to see if it is the root element by using not(ancestor::*). Nested sections are numbered from there because each level of section number is generated by first computing the ancestor numbers, so the first subsection would be 6.2.1.

Bob Stayton
Sagehill Enterprises
[email protected]

--------------------------------------------------
From: "Joshua Wulf" <[email protected]>
Sent: Wednesday, April 03, 2013 10:02 PM
To: <[email protected]>
Subject: [docbook] Arbitrarily start section numbering?

Can I give an argument to xsltproc to have the docbook style sheets transform my section with an arbitrary section number, rather than starting at "1"?

I'd like to be able to do this, in essence:

xsltproc --output myrenderedsection.html \
 --stringparam start.numbering.at 6.2 \
 html/docbook.xsl section.xml

- Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to