At 03:20 27/06/2004, Paul W. Frields wrote:
I still have a sticky situation, though, which I have not been able to fully address, which is the treatment of the section numbering. I chose to assign the chapters roman numeral labels (I, II...) to match the original, and used <simplesect> sections so that I could manually number the rules as in the original text,
If you were not marking up to get the numbering, how would you have marked them up?
with the numbering persisting across chapters, rather than mucking with awkward labeling like "III.2" caused by the chapter labels and the automatic formatting from (I assume) the various XSL and other widgets.
With, say, a 'section' markup, a single template could be used to provide the cross document numbering. Tested by a sed, changing simplesect for section. You'll need to remove the manual numbering though, but that isn't part of the 'standard' you say?
I keep my docbook stylesheets in /sgml/nw/docbook/ Adjust as necessary. This stylesheet modifies the bit needed, then imports all the standard docbook stuff.
HTH DaveP
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0' xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default">
<xsl:import href="/sgml/nw/docbook/docbook-xsl-1.62.4/html/docbook.xsl"/>
<xsl:variable name="toc.section.depth">3</xsl:variable> <!-- Add other variable definitions here -->
<xsl:template name="section.heading"> <xsl:param name="section" select="."/> <xsl:param name="level" select="1"/> <xsl:param name="allow-anchors" select="1"/> <xsl:param name="title"/> <xsl:param name="class" select="'title'"/>
<xsl:variable name="id"> <xsl:choose> <!-- if title is in an *info wrapper, get the grandparent --> <xsl:when test="contains(local-name(..), 'info')"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="../.."/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="object.id"> <xsl:with-param name="object" select=".."/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:variable>
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel" select="$level + 1"/>
<xsl:element name="h{$hlevel}">
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
<xsl:if test="$css.decoration != '0'">
<xsl:if test="$hlevel<3">
<xsl:attribute name="style">clear: both</xsl:attribute>
</xsl:if>
</xsl:if>
<xsl:if test="$allow-anchors != 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$section"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:number level="multiple"
count="section"
from="book"
format="I"/> 
<xsl:copy-of select="$title"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>