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:element name="anchor">
140
<xsl:attribute name="id">
141
<xsl:value-of select="translate(translate(string(.),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
144
<xsl:value-of select="."/>
146
<xsl:element name="variablelist">
147
<xsl:element name="varlistentry">
148
<xsl:element name="listitem">
149
<xsl:element name="para">
150
<xsl:text>This parameter is a synonym for </xsl:text>
151
<xsl:element name="link">
152
<xsl:attribute name="linkend">
153
<xsl:value-of select="translate(translate(string($name),' ',''), 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
155
<xsl:value-of select="$name"/>
157
<xsl:text>.</xsl:text>
162
<xsl:text> </xsl:text>
166
<xsl:element name="section">
167
<xsl:element name="indexterm">
168
<xsl:attribute name="significance">
169
<xsl:text>preferred</xsl:text>
171
<xsl:element name="primary">
172
<xsl:value-of select="@name"/>
175
<xsl:copy-of select="$term"/>
176
<xsl:element name="variablelist">
177
<xsl:element name="varlistentry">
178
<xsl:element name="listitem">
179
<xsl:copy-of select="$content"/> <xsl:text> </xsl:text>
180
<xsl:copy-of select="$default"/> <xsl:text> </xsl:text>
181
<xsl:copy-of select="$examples"/> <xsl:text> </xsl:text>
185
<xsl:text> </xsl:text>