<!-- ==================================================================== -->
-<xsl:template match="refsection|refsect1">
- <xsl:choose>
- <xsl:when test="ancestor::refsection">
- <xsl:text>.SS "</xsl:text>
- <xsl:value-of select="title[1]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>.SH "</xsl:text>
- <xsl:value-of
- select="translate(title[1],
- 'abcdefghijklmnopqrstuvwxyz',
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="refsect2">
- <xsl:text>.SS "</xsl:text>
- <xsl:value-of select="title[1]"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="refsynopsisdiv">
- <xsl:text>.SH "</xsl:text>
- <xsl:call-template name="string.upper">
- <xsl:with-param name="string">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:text>" </xsl:text>
+<xsl:template match="caution|important|note|tip|warning">
+ <xsl:call-template name="nested-section-title"/>
+ <xsl:text> </xsl:text>
<xsl:apply-templates/>
-</xsl:template>
+</xsl:template>
-<xsl:template match="refnamediv">
- <xsl:text>.SH "</xsl:text>
- <xsl:call-template name="string.upper">
- <xsl:with-param name="string">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'RefName'"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:text>" </xsl:text>
- <xsl:for-each select="refname">
- <xsl:if test="position()>1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:value-of select="."/>
- </xsl:for-each>
- <xsl:text> \- </xsl:text>
- <xsl:value-of select="normalize-space (refpurpose)"/>
+<xsl:template match="formalpara">
+ <xsl:call-template name="nested-section-title"/>
<xsl:text> </xsl:text>
+ <xsl:text>.RS 3 </xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>.RE </xsl:text>
</xsl:template>
-<xsl:template match="refentry/refentryinfo"></xsl:template>
-
-<xsl:template match="caution|important|note|tip|warning">
- <xsl:text>.RS .Sh "</xsl:text>
- <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
- <xsl:text>" </xsl:text>
- <xsl:apply-templates/>
- <xsl:text>.RE </xsl:text>
-</xsl:template>
-
<xsl:template match="para">
<xsl:text>.PP </xsl:text>
<xsl:call-template name="mixed-block"/>
<!-- Yes, address and synopsis are verbatim environments. -->
<xsl:choose>
- <!-- Check to see if this vertbatim item is within a parent element that -->
+ <!-- Check to see if this verbatim item is within a parent element that -->
<!-- allows mixed content. -->
<!-- If it is within a mixed-content parent, then a line break is -->
<!-- ==================================================================== -->
<xsl:import href="../html/docbook.xsl"/>
+<xsl:include href="param.xsl"/>
<xsl:include href="general.xsl"/>
+<xsl:include href="refentry.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="inline.xsl"/>
<xsl:include href="synop.xsl"/>
<!-- ============================================================== -->
-<!-- The real fun starts here -->
-
-<!-- ============================================================== -->
-
<xsl:template match="refentry">
- <xsl:variable name="get.metainfo">
- <xsl:call-template name="get.metainfo" />
+ <xsl:variable name="get.metadata">
+ <xsl:call-template name="get.metadata"/>
</xsl:variable>
-
- <xsl:variable name="metainfo" select="exsl:node-set($get.metainfo)"/>
+
+ <xsl:variable name="metadata" select="exsl:node-set($get.metadata)"/>
<xsl:call-template name="write.text.chunk">
- <xsl:with-param name="filename" select="$metainfo/filename"/>
+ <xsl:with-param name="filename" select="$metadata/filename"/>
<xsl:with-param name="content">
- <!-- page header (commented-out stuff at top of roff source) -->
+ <!-- page header (commented-out at top of roff source) -->
<xsl:call-template name="page.header"/>
<!-- .TH line (sets title stuff and begin and end)-->
<xsl:call-template name="TH.title.section">
- <xsl:with-param name="reftitle" select="$metainfo/reftitle"/>
- <xsl:with-param name="section" select="$metainfo/section"/>
- <xsl:with-param name="date" select="$metainfo/date"/>
- <xsl:with-param name="productname" select="$metainfo/productname"/>
- <xsl:with-param name="title" select="$metainfo/title"/>
+ <xsl:with-param name="reftitle" select="$metadata/reftitle"/>
+ <xsl:with-param name="section" select="$metadata/section"/>
+ <xsl:with-param name="date" select="$metadata/date"/>
+ <xsl:with-param name="productname" select="$metadata/productname"/>
+ <xsl:with-param name="extra3" select="$metadata/extra3"/>
</xsl:call-template>
<!-- main body of man page -->
<!-- Now generate stub include pages for every page documented in
this refentry (except the page itself) -->
<xsl:for-each select="refnamediv/refname">
- <xsl:if test=". != $metainfo/name">
+ <xsl:if test=". != $metadata/name">
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename"
select="concat(normalize-space(.), '.',
- $metainfo/section)"/>
+ $metadata/section)"/>
<xsl:with-param
name="content"
select="concat('.so man',
- $metainfo/section,
+ $metadata/section,
'/',
- $metainfo/name,
+ $metadata/name,
'.',
- $metainfo/section,
+ $metadata/section,
' ')"/>
</xsl:call-template>
</xsl:if>
<!-- ============================================================== -->
-<!-- Named templates for each "part" of output page: -->
+<!-- Named templates for each part of output page -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<xsl:template name="page.header">
- <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
-.\"
-. \"---------------------------------------------------
-.de Sh \" - a second-level section (a DocBook refsect2)
-.br
-.if t .Sp
-.ne 5
-\fB\\$1\fR
-.PP
-..\"---------------------------------------------------
-.de Sp \" - vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..\"---------------------------------------------------
-.de Ip \" - a list item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..\"---------------------------------------------------
-.\"</xsl:text>
-<xsl:text> </xsl:text>
+ <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source. </xsl:text>
</xsl:template>
<xsl:template name="TH.title.section">
- <xsl:param name="title"/>
<xsl:param name="reftitle"/>
<xsl:param name="section"/>
<xsl:param name="date"/>
<xsl:param name="productname"/>
+ <xsl:param name="extra3"/>
<xsl:text>.\" "TITLE" "SECTION NUMBER" "DATE" "PRODUCT" "GROUP TITLE"</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>" "</xsl:text>
<xsl:value-of select="normalize-space($productname)"/>
<xsl:text>" "</xsl:text>
- <xsl:value-of select="$title"/>
+ <xsl:value-of select="normalize-space($extra3)"/>
<xsl:text>" </xsl:text>
</xsl:template>
<!-- ============================================================== -->
-<!-- Named template for getting metainfo from source -->
+<!-- Named template for getting metadata -->
<!-- ============================================================== -->
-<xsl:template name="get.metainfo">
+<xsl:template name="get.metadata">
+
+ <xsl:variable name="name" select="refnamediv/refname[1]"/>
<xsl:variable name="section">
<xsl:choose>
<xsl:value-of select="$section"/>
</section>
- <xsl:variable name="name" select="refnamediv/refname[1]"/>
-
- <name>
- <xsl:value-of select="$name"/>
- </name>
-
- <!-- standard man page width is 64 chars; 6 chars needed for the two
- (x) volume numbers, and 2 spaces, leaves 56 -->
- <xsl:variable name="twidth" select="(56 - string-length(refmeta/refentrytitle)) div 2"/>
-
- <reftitle>
- <xsl:value-of select="substring(refmeta/refentrytitle, 1, $twidth)"/>
- </reftitle>
+ <filename>
+ <xsl:call-template name="replace-string">
+ <!-- replace spaces in source filename with underscores in output filename -->
+ <xsl:with-param name="content"
+ select="concat(normalize-space ($name), '.', $section)"/>
+ <xsl:with-param name="replace" select="' '"/>
+ <xsl:with-param name="with" select="'_'"/>
+ </xsl:call-template>
+ </filename>
- <title>
+ <xsl:variable name="reftitle">
<xsl:choose>
- <xsl:when test="refentryinfo/title">
- <xsl:value-of select="refentryinfo/title"/>
- </xsl:when>
- <xsl:when test="../referenceinfo/title">
- <xsl:value-of select="../referenceinfo/title"/>
+ <xsl:when test="refmeta/refentrytitle">
+ <xsl:copy>
+ <xsl:apply-templates select="refmeta/refentrytitle/node()"/>
+ </xsl:copy>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$name"/>
+ </xsl:otherwise>
</xsl:choose>
- </title>
+ </xsl:variable>
+
+ <reftitle>
+ <xsl:value-of select="substring($reftitle, 1, 20)"/>
+ </reftitle>
<date>
<xsl:choose>
- <xsl:when test="refentryinfo/date">
- <xsl:value-of select="refentryinfo/date"/>
+ <xsl:when test="info/date">
+ <xsl:copy>
+ <xsl:apply-templates select="info/date/node()"/>
+ </xsl:copy>
</xsl:when>
- <xsl:when test="../referenceinfo/date">
- <xsl:value-of select="../referenceinfo/date"/>
+ <xsl:when test="refentryinfo/date">
+ <xsl:copy>
+ <xsl:apply-templates select="refentryinfo/date/node()"/>
+ </xsl:copy>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates select="../referenceinfo/date/node()"/>
+ </xsl:copy>
+ </xsl:otherwise>
</xsl:choose>
</date>
-
+
<productname>
<xsl:choose>
- <xsl:when test="refentryinfo/productname">
- <xsl:value-of select="refentryinfo/productname"/>
+ <xsl:when test="info/productname">
+ <xsl:apply-templates select="info/productname/node()"/>
</xsl:when>
- <xsl:when test="../referenceinfo/productname">
- <xsl:value-of select="../referenceinfo/productname"/>
+ <xsl:when test="refentryinfo/productname">
+ <xsl:apply-templates select="refentryinfo/productnam/node()"/>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="../referenceinfo/productname/node()"/>
+ </xsl:otherwise>
</xsl:choose>
</productname>
-
- <filename>
- <xsl:call-template name="replace-string">
- <!-- replace spaces in source filename with underscores in output filename -->
- <xsl:with-param name="content"
- select="concat(normalize-space ($name), '.', $section)"/>
- <xsl:with-param name="replace" select="' '"/>
- <xsl:with-param name="with" select="'_'"/>
- </xsl:call-template>
- </filename>
+
+ <extra3></extra3>
</xsl:template>
</xsl:if>
</xsl:template>
-<xsl:template match="copyright">
- <xsl:text>Copyright \(co </xsl:text>
- <xsl:apply-templates select="./year" />
- <xsl:text>.Sp </xsl:text>
-</xsl:template>
-
<xsl:template match="email">
<xsl:text><</xsl:text>
<xsl:apply-templates/>
<xsl:text>></xsl:text>
</xsl:template>
+<xsl:template match="copyright">
+ <xsl:text>Copyright \(co </xsl:text>
+ <xsl:apply-templates select="./year" />
+ <xsl:text>.Sp </xsl:text>
+</xsl:template>
+
</xsl:stylesheet>
--- /dev/null
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version='1.0'>
+
+<!-- ********************************************************************
+ $Id$
+ ********************************************************************
+
+ This file is part of the XSL DocBook Stylesheet distribution.
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
+ copyright and other information.
+
+ ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+ <xsl:template match="refnamediv">
+ <xsl:text>.SH "</xsl:text>
+ <xsl:call-template name="string.upper">
+ <xsl:with-param name="string">
+ <xsl:call-template name="gentext">
+ <xsl:with-param name="key" select="'RefName'"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>" </xsl:text>
+ <xsl:for-each select="refname">
+ <xsl:if test="position()>1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </xsl:for-each>
+ <xsl:text> \- </xsl:text>
+ <xsl:value-of select="normalize-space (refpurpose)"/>
+ <xsl:text> </xsl:text>
+ </xsl:template>
+
+ <xsl:template match="refsynopsisdiv">
+ <xsl:text>.SH "</xsl:text>
+ <xsl:call-template name="string.upper">
+ <xsl:with-param name="string">
+ <xsl:call-template name="gentext">
+ <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>" </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="refsection|refsect1">
+ <xsl:choose>
+ <xsl:when test="ancestor::refsection">
+ <xsl:text>.SS "</xsl:text>
+ <xsl:value-of select="title[1]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>.SH "</xsl:text>
+ <xsl:value-of
+ select="translate(title[1],
+ 'abcdefghijklmnopqrstuvwxyz',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>" </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="refsect2">
+ <xsl:text>.SS "</xsl:text>
+ <xsl:value-of select="title[1]"/>
+ <xsl:text>" </xsl:text>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="refsect3">
+ <xsl:call-template name="nested-section-title"/>
+ <xsl:text> </xsl:text>
+ <xsl:text>.RS 3 </xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>.RE </xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>