2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
exsl=
"http://exslt.org/common"
4 xmlns:
samba=
"http://samba.org/common"
6 extension-element-prefixes=
"exsl">
8 <xsl:output method=
"xml"/>
10 <xsl:param name=
"xmlSambaNsUri" select=
"'http://samba.org/common'"/>
12 <xsl:template match=
"reference/refentry/refsect1">
13 <xsl:if test=
"title!='VERSION' and title!='AUTHOR'">
14 <xsl:element name=
"refsect1">
15 <xsl:if test=
"@id!=''">
16 <xsl:attribute name=
"id">
17 <xsl:value-of select=
"@id"/>
20 <xsl:apply-templates/>
25 <xsl:template match=
"reference/refentry">
26 <xsl:element name=
"section">
27 <xsl:attribute name=
"id">
28 <xsl:value-of select=
"@id"/>
30 <xsl:element name=
"title">
31 <xsl:value-of select=
"refmeta/refentrytitle"/>
32 <!-- <xsl:text> (</xsl:text>
33 <xsl:value-of select="refnamediv/refpurpose"/>
34 <xsl:text>)</xsl:text>-->
36 <xsl:apply-templates/>
40 <xsl:template match=
"reference/refentry/refmeta"/>
42 <xsl:template match=
"reference/refentry/refnamediv"/>
44 <xsl:template match=
"reference">
45 <xsl:element name=
"appendix">
46 <xsl:attribute name=
"id">
47 <xsl:value-of select=
"@id"/>
49 <xsl:apply-templates/>
53 <xsl:template match=
"/node()">
54 <xsl:text disable-output-escaping=
"yes">
55 <!DOCTYPE
</xsl:text><xsl:value-of select=
"name(.)"/><xsl:text disable-output-escaping=
"yes"> PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
56 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
58 <!ENTITY % globalentities SYSTEM 'global.ent'
> %globalentities;
62 <xsl:attribute name=
"id"><xsl:value-of select=
"@id"/></xsl:attribute>
63 <xsl:apply-templates/>
68 <!-- This is needed to copy content unchanged -->
69 <xsl:template match=
"@*|node()">
72 <xsl:apply-templates select=
"@*|node()"/>
76 <xsl:template match=
"smbconfexample/smbconfoption|smbconfblock/smbconfoption">
77 <xsl:element name=
"member">
78 <xsl:element name=
"parameter">
79 <xsl:value-of select=
"name"/>
81 <xsl:when test=
"value != ''">
82 <xsl:text> =
</xsl:text>
83 <xsl:value-of select=
"value"/>
90 <xsl:template match=
"smbconfexample/smbconfcomment">
91 <xsl:element name=
"member">
92 <xsl:text>#
</xsl:text>
93 <xsl:apply-templates/>
97 <xsl:template match=
"smbconfexample/smbconfsection">
98 <xsl:element name=
"member">
99 <xsl:text> </xsl:text>
101 <xsl:element name=
"member">
102 <xsl:element name=
"parameter">
103 <xsl:apply-templates/>
108 <xsl:template match=
"smbconfoption">
109 <!-- Include an index term -->
110 <xsl:element name=
"indexterm">
111 <xsl:element name=
"primary">
112 <xsl:value-of select=
"name"/>
116 <!-- FIXME: Do this only when smb.conf is included
117 <xsl:element name="link">
118 <xsl:attribute name="linkend">
119 <xsl:value-of select="translate(translate(string(name),' ',''),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
122 <xsl:element name=
"parameter">
123 <xsl:attribute name=
"moreinfo">
124 <xsl:text>none
</xsl:text>
126 <xsl:value-of select=
"name"/>
130 <xsl:when test=
"value != ''">
131 <xsl:text> =
</xsl:text>
132 <xsl:value-of select=
"value"/>
139 <!-- FIXME: Needs extension sometime -->
140 <xsl:template match=
"ntgroup|ntuser">
141 <xsl:element name=
"emphasis">
142 <xsl:apply-templates/>
146 <xsl:template match=
"smbconfexample">
148 <xsl:when test=
"title = ''">
150 <xsl:text>Warning: smbconfexample does not have title!
</xsl:text>
154 <xsl:element name=
"example">
156 <xsl:when test=
"@id != ''">
157 <xsl:attribute name=
"id">
158 <xsl:value-of select=
"@id"/>
163 <xsl:element name=
"title">
164 <xsl:value-of select=
"title"/>
166 <xsl:element name=
"simplelist">
167 <xsl:apply-templates/>
172 <xsl:template match=
"smbconfblock">
173 <xsl:element name=
"simplelist">
174 <xsl:apply-templates/>
178 <xsl:template match=
"smbconfsection">
179 <xsl:element name=
"parameter">
180 <xsl:apply-templates/>
184 <xsl:template match=
"smbconfcomment">
185 <xsl:text>#
</xsl:text>
186 <xsl:apply-templates/>
189 <xsl:template match=
"image">
190 <xsl:element name=
"figure">
191 <xsl:attribute name=
"id"><xsl:value-of select=
"imagefile"/></xsl:attribute>
192 <xsl:element name=
"title">
193 <xsl:value-of select=
"imagedescription"/>
195 <xsl:element name=
"mediaobject">
196 <xsl:element name=
"imageobject">
197 <xsl:attribute name=
"role"><xsl:text>latex
</xsl:text></xsl:attribute>
198 <xsl:element name=
"imagedata">
199 <xsl:attribute name=
"fileref">
200 <xsl:text>projdoc/imagefiles/
</xsl:text><xsl:value-of select=
"imagefile"/></xsl:attribute>
201 <xsl:attribute name=
"scale">
203 <xsl:when test=
"@scale != ''">
204 <xsl:value-of select=
"@scale"/>
208 <xsl:text>50</xsl:text>
212 <xsl:attribute name=
"scalefit"><xsl:text>1</xsl:text></xsl:attribute>
215 <xsl:element name=
"imageobject">
216 <xsl:element name=
"imagedata">
217 <xsl:attribute name=
"fileref">
218 <xsl:text>projdoc/imagefiles/
</xsl:text><xsl:value-of select=
"imagefile"/><xsl:text>.png
</xsl:text></xsl:attribute>
219 <xsl:attribute name=
"scale"><xsl:text>50</xsl:text></xsl:attribute>
220 <xsl:attribute name=
"scalefit"><xsl:text>1</xsl:text></xsl:attribute>
227 <xsl:template match=
"//samba:parameter">
228 <!-- reconstruct varlistentry - not all of them will go into separate files
229 and also we must repair the main varlistentry itself.
231 <xsl:variable name=
"name"><xsl:value-of select=
"translate(translate(string(@name),' ',''),
232 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
235 <xsl:variable name=
"anchor">
236 <xsl:element name=
"anchor">
237 <xsl:attribute name=
"id">
238 <xsl:value-of select=
"$name"/>
243 <xsl:variable name=
"context">
244 <xsl:text> (
</xsl:text>
245 <xsl:value-of select=
"@context"/>
246 <xsl:text>)
</xsl:text>
249 <xsl:variable name=
"term">
250 <xsl:element name=
"term">
251 <xsl:copy-of select=
"$anchor"/>
252 <xsl:value-of select=
"@name"/>
253 <xsl:value-of select=
"$context"/>
257 <xsl:variable name=
"content">
258 <xsl:apply-templates/>
261 <xsl:element name=
"varlistentry">
262 <xsl:text> </xsl:text>
263 <xsl:element name=
"indexterm">
264 <xsl:attribute name=
"significance">
265 <xsl:text>preferred
</xsl:text>
267 <xsl:element name=
"primary">
268 <xsl:value-of select=
"@name"/>
271 <xsl:copy-of select=
"$term"/>
272 <xsl:copy-of select=
"$content"/>
279 <xsl:template match=
"ulink">
280 <xsl:element name=
"ulink">
281 <xsl:attribute name=
"url">
282 <xsl:value-of select=
"@url"/>
285 <xsl:apply-templates/>