3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
5 Customization xsl stylesheet for docbook to chunked html transform
7 @copyright (c) 2007-2015 G. Giunta
8 @license code licensed under the BSD License
10 @todo make the xsl more dynamic: the path to import chunk.xsl could be f.e. rewritten/injected by the php user.
11 This would be needed f.e. if the lib is installed as a dependency and is not the top-level composer project.
12 Note: according to http://stackoverflow.com/questions/9861355/using-dynamic-href-in-xslt-import-include this is
13 not easy to do - it would have to be done f.e. by the invoking php script...
17 <!-- import base stylesheet -->
18 <xsl:import href="../../../../vendor/docbook/docbook-xsl/xhtml/chunk.xsl"/>
21 <!-- customization vars -->
22 <xsl:param name="draft.mode">no</xsl:param>
23 <xsl:param name="funcsynopsis.style">ansi</xsl:param>
24 <xsl:param name="html.stylesheet">xmlrpc.css</xsl:param>
25 <xsl:param name="id.warnings">0</xsl:param>
28 <!-- elements added / modified -->
30 <!-- space between function name and opening parenthesis -->
31 <xsl:template match="funcdef" mode="ansi-nontabular">
33 <xsl:apply-templates select="." mode="class.attribute"/>
34 <xsl:apply-templates mode="ansi-nontabular"/>
35 <xsl:text> ( </xsl:text>
39 <!-- space between return type and function name -->
40 <xsl:template match="funcdef/type" mode="ansi-nontabular">
41 <xsl:apply-templates mode="ansi-nontabular"/>
42 <xsl:text> </xsl:text>
45 <!-- space between last param and closing parenthesis, remove tailing semicolon -->
46 <xsl:template match="void" mode="ansi-nontabular">
50 <xsl:template match="varargs" mode="ansi-nontabular">
51 <xsl:text>...</xsl:text>
55 <xsl:template match="paramdef" mode="ansi-nontabular">
56 <xsl:apply-templates mode="ansi-nontabular"/>
58 <xsl:when test="following-sibling::*">
59 <xsl:text>, </xsl:text>
67 <!-- param types get code formatted (leave a space after type, as it is supposed to be before param name) -->
68 <xsl:template match="paramdef/type" mode="ansi-nontabular">
70 <xsl:when test="$funcsynopsis.decoration != 0">
72 <xsl:apply-templates mode="ansi-nontabular"/>
77 <xsl:apply-templates mode="ansi-nontabular"/>
81 <xsl:text> </xsl:text>
84 <!-- default values for function parameters -->
85 <xsl:template match="paramdef/initializer" mode="ansi-nontabular">
86 <xsl:text> = </xsl:text>
87 <xsl:apply-templates mode="ansi-nontabular"/>