3
smb.conf-documentation specific stylesheets
4
Published under the GNU GPL
6
(C) Jelmer Vernooij 2002-2004
7
(C) Alexander Bokovoy 2002-2004
9
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"
13
<xsl:template match="description"><xsl:apply-templates/></xsl:template>
15
<xsl:template match="value"><xsl:element name="literal"><xsl:apply-templates/></xsl:element></xsl:template>
17
<xsl:template match="command"><xsl:element name="literal"><xsl:apply-templates/></xsl:element></xsl:template>
19
<xsl:template match="synonym"><xsl:apply-templates/></xsl:template>
21
<xsl:template match="related"><xsl:element name="para"><xsl:text>Related command</xsl:text><xsl:apply-templates/></xsl:element></xsl:template>
23
<xsl:template match="samba:parameterlist">
25
<xsl:sort select="samba:parameter/@name"/>
26
</xsl:apply-templates>
29
<xsl:template match="value/comment">
30
<xsl:text> # </xsl:text>
31
<xsl:apply-templates/>
34
<xsl:template match="samba:parameter">
35
<xsl:variable name="cname"><xsl:value-of select="translate(translate(string(@name),' ',''),
36
'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
39
<xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
41
<xsl:variable name="anchor">
42
<xsl:element name="anchor">
43
<xsl:attribute name="id">
44
<xsl:value-of select="$cname"/>
49
<xsl:variable name="context">
50
<xsl:text> (</xsl:text>
51
<xsl:value-of select="@context"/>
52
<xsl:text>)</xsl:text>
55
<xsl:variable name="term">
56
<xsl:copy-of select="$anchor"/>
57
<xsl:element name="title">
58
<xsl:text> </xsl:text>
59
<xsl:text> </xsl:text>
60
<xsl:value-of select="@name"/>
61
<xsl:value-of select="$context"/>
62
<xsl:text> </xsl:text>
67
<!-- Generate list of examples -->
68
<xsl:variable name="examples">
69
<xsl:for-each select="value">
70
<xsl:if test="@type = 'example'">
71
<xsl:element name="para">
72
<xsl:text>Example: </xsl:text>
73
<xsl:element name="emphasis">
74
<xsl:element name="parameter">
75
<xsl:copy-of select="$name"/>
77
<xsl:text> = </xsl:text>
78
<xsl:apply-templates select="."/>
79
<xsl:text> </xsl:text>
81
<xsl:text> </xsl:text>
87
<xsl:variable name="tdefault">
88
<xsl:for-each select="value">
89
<xsl:if test="@type = 'default'">
90
<xsl:element name="para">
91
<xsl:text>Default: </xsl:text>
92
<xsl:element name="emphasis">
93
<xsl:element name="parameter">
94
<xsl:copy-of select="$name"/>
96
<xsl:text> = </xsl:text>
97
<xsl:apply-templates select="."/>
98
<xsl:text> </xsl:text>
100
<xsl:text> </xsl:text>
106
<xsl:variable name="default">
108
<xsl:when test="$tdefault = ''">
109
<xsl:element name="para">
110
<xsl:element name="emphasis">
111
<xsl:text>No default</xsl:text>
116
<xsl:copy-of select="$tdefault"/>
121
<xsl:variable name="content">
122
<xsl:apply-templates select="description"/>
125
<xsl:for-each select="synonym">
126
<xsl:element name="section">
127
<xsl:element name="indexterm">
128
<xsl:attribute name="significance">
129
<xsl:text>preferred</xsl:text>
131
<xsl:element name="primary">
132
<xsl:value-of select="."/>
134
<xsl:element name="see">
135
<xsl:value-of select="$name"/>
138
<xsl:element name="title">
139
<xsl:text> </xsl:text>
140
<xsl:text> </xsl:text>
141
<xsl:element name="anchor">
142
<xsl:attribute name="id">
143
<xsl:value-of select="translate(translate(string(.),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
146
<xsl:value-of select="."/>
147
<xsl:text> </xsl:text>
149
<xsl:element name="variablelist">
150
<xsl:element name="varlistentry">
151
<xsl:element name="listitem">
152
<xsl:element name="para">
153
<xsl:text>This parameter is a synonym for </xsl:text>
154
<xsl:element name="link">
155
<xsl:attribute name="linkend">
156
<xsl:value-of select="translate(translate(string($name),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
158
<xsl:value-of select="$name"/>
160
<xsl:text>.</xsl:text>
165
<xsl:text> </xsl:text>
169
<xsl:element name="section">
170
<xsl:element name="indexterm">
171
<xsl:attribute name="significance">
172
<xsl:text>preferred</xsl:text>
174
<xsl:element name="primary">
175
<xsl:value-of select="@name"/>
178
<xsl:copy-of select="$term"/>
179
<xsl:element name="variablelist">
180
<xsl:element name="varlistentry">
181
<xsl:element name="listitem">
182
<xsl:copy-of select="$content"/> <xsl:text> </xsl:text>
183
<xsl:copy-of select="$default"/> <xsl:text> </xsl:text>
184
<xsl:copy-of select="$examples"/> <xsl:text> </xsl:text>
188
<xsl:text> </xsl:text>