Add 'php/phpxmlrpc/' from commit 'cd5dbb4a511e7a616a61187a5de1a611a9748cbd'
[plcapi.git] / php / phpxmlrpc / doc / build / custom.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet
3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <!--
5  Customization xsl stylesheet for docbook to chunked html transform
6  @author Gaetano Giunta
7  @copyright (c) 2007-2015 G. Giunta
8  @license code licensed under the BSD License
9
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...
14 -->
15
16
17 <!-- import base stylesheet -->
18 <xsl:import href="../../../../vendor/docbook/docbook-xsl/xhtml/chunk.xsl"/>
19
20
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>
26
27
28 <!-- elements added / modified -->
29
30 <!-- space between function name and opening parenthesis -->
31 <xsl:template match="funcdef" mode="ansi-nontabular">
32   <code>
33     <xsl:apply-templates select="." mode="class.attribute"/>
34     <xsl:apply-templates mode="ansi-nontabular"/>
35     <xsl:text> ( </xsl:text>
36   </code>
37 </xsl:template>
38
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>
43 </xsl:template>
44
45 <!-- space between last param and closing parenthesis, remove tailing semicolon -->
46 <xsl:template match="void" mode="ansi-nontabular">
47   <code>void )</code>
48 </xsl:template>
49
50 <xsl:template match="varargs" mode="ansi-nontabular">
51   <xsl:text>...</xsl:text>
52   <code> )</code>
53 </xsl:template>
54
55 <xsl:template match="paramdef" mode="ansi-nontabular">
56   <xsl:apply-templates mode="ansi-nontabular"/>
57   <xsl:choose>
58     <xsl:when test="following-sibling::*">
59       <xsl:text>, </xsl:text>
60     </xsl:when>
61     <xsl:otherwise>
62       <code> )</code>
63     </xsl:otherwise>
64   </xsl:choose>
65 </xsl:template>
66
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">
69   <xsl:choose>
70     <xsl:when test="$funcsynopsis.decoration != 0">
71       <code>
72         <xsl:apply-templates mode="ansi-nontabular"/>
73       </code>
74     </xsl:when>
75     <xsl:otherwise>
76       <code>
77         <xsl:apply-templates mode="ansi-nontabular"/>
78       </code>
79     </xsl:otherwise>
80   </xsl:choose>
81   <xsl:text> </xsl:text>
82 </xsl:template>
83
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"/>
88 </xsl:template>
89
90
91 </xsl:stylesheet>