]> granicus.if.org Git - docbook-dsssl/commitdiff
If the refmeta contains no manvolnum, then:
authorJoe Orton <jorton@redhat.com>
Sat, 15 Mar 2003 08:38:13 +0000 (08:38 +0000)
committerJoe Orton <jorton@redhat.com>
Sat, 15 Mar 2003 08:38:13 +0000 (08:38 +0000)
- if the refentry contains a funcsynopsis, default to section 3
- otherwise, default to section 1

xsl/manpages/docbook.xsl

index a40c523a5a7e74fb74df85ed1ec22652da7d9020..a5b7ac0d64502959a4d957b7c9304cf326509a7d 100644 (file)
 
   
 <xsl:template match="refentry">
-  <xsl:variable name="section" select="refmeta/manvolnum"/>
+
+  <xsl:variable name="section">
+    <xsl:choose>
+      <xsl:when test="refmeta/manvolnum">
+        <xsl:value-of select="refmeta/manvolnum[1]"/>
+      </xsl:when>
+      <xsl:when test=".//funcsynopsis">3</xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <xsl:variable name="name" select="refnamediv/refname[1]"/>
 
   <!-- standard man page width is 64 chars; 6 chars needed for the two
 .TH "</xsl:text>
       <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
       <xsl:text>" </xsl:text>
-      <xsl:value-of select="refmeta/manvolnum[1]"/>
+      <xsl:value-of select="$section"/>
       <xsl:text> "</xsl:text>
       <xsl:value-of select="normalize-space($date)"/>
       <xsl:text>" "</xsl:text>