]> granicus.if.org Git - docbook-dsssl/commitdiff
Made subtitles in sections scale to proper heading level.
authorBob Stayton <bobs@sagehill.net>
Mon, 25 Nov 2002 18:26:47 +0000 (18:26 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 25 Nov 2002 18:26:47 +0000 (18:26 +0000)
xsl/html/sections.xsl

index 472f2a2c812f41f2a3ef4b2572f5cf8a7dd99fbf..fe082ee26ba6d7b08f64400178e89cfde1fc63ee 100644 (file)
   </xsl:element>
 </xsl:template>
 
+<xsl:template match="section/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template match="sect1/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template match="sect2/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template match="sect3/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template match="sect4/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template match="sect5/subtitle" mode="titlepage.mode" priority="2">
+  <xsl:call-template name="section.subtitle"/>
+</xsl:template>
+
+<xsl:template name="section.subtitle">
+  <!-- the context node should be the subtitle of a section when called -->
+  <xsl:variable name="section" select="(ancestor::section
+                                        |ancestor::simplesect
+                                        |ancestor::sect1
+                                        |ancestor::sect2
+                                        |ancestor::sect3
+                                        |ancestor::sect4
+                                        |ancestor::sect5)[last()]"/>
+
+  <xsl:variable name="level">
+    <xsl:call-template name="section.level">
+      <xsl:with-param name="node" select="$section"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="section.heading">
+    <xsl:with-param name="section" select=".."/>
+    <!-- subtitle heading level one higher than section level -->
+    <xsl:with-param name="level" select="$level + 1"/>
+    <xsl:with-param name="title">
+      <xsl:apply-templates select="$section" mode="object.subtitle.markup">
+        <xsl:with-param name="allow-anchors" select="1"/>
+      </xsl:apply-templates>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
 </xsl:stylesheet>