1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
<xsl:param name="man.base.url.for.relative.links"></xsl:param>
<!-- OpenCL XML sources are not very man-friendly: they have a single
refentry with comma-space separated entries instead of multiple refentries,
and some general pages have refentry names that are not individual function names.
Therefore, we can't use the default write.man.file template from the docbook manpage
stylesheet, and it's better to specify the output filename on the command line instead. -->
<xsl:template name="write.man.file">
<xsl:param name="name"/>
<xsl:param name="section"/>
<xsl:param name="lang"/>
<xsl:param name="content"/>
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename" select="''"/>
<xsl:with-param name="suppress-context-node-name" select="1"/>
<xsl:with-param name="quiet" select="$man.output.quietly"/>
<xsl:with-param
name="message-prolog"
>Note: </xsl:with-param>
<xsl:with-param name="encoding" select="$man.output.encoding"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
<!-- citerefentry should use the href to get the correct reference if present.
also, no manvolnum is specified in the OpenCL pages, so assume our own -->
<xsl:template match="citerefentry">
<xsl:variable name="vol" select="/refentry/refmeta/manvolnum"/>
<xsl:variable name="entry">
<xsl:choose>
<xsl:when test="@href">
<xsl:value-of select="@href"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="refentrytitle"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="do-citerefentry">
<xsl:with-param name="refentrytitle" select="$entry"/>
<xsl:with-param name="manvolnum" select="$vol"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
|