1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="2.0">
3 <xsl:output method="html" indent="yes" omit-xml-declaration="yes" encoding="ISO-8859-1"/>
4 <xsl:param name="confdir" select="'/etc/vservers'"/>
5 <!-- set following parameter to anything else than 'true' to use a symbolic character to mark up file types -->
6 <xsl:param name="printstylename" select="'true'"/>
8 <xsl:template match="/database">
9 <h1>The contents of the <xsl:value-of select="$confdir"/> directory</h1>
10 This page is automatically created by XSL transformation of configuration.xml. Additions, corrections, etc. should be made in that file, not in the Wiki page.
12 <xsl:when test="$printstylename = 'true'">
13 Directory names are written in <b>bold</b> letters.
15 Boolean files are files without content. Only existence matters.
17 Scalar files are files with only one line (one value).
19 List files are files with multiple values. One value per line.
21 Hash files are files with multiple key/value pairs. One key/value pair per line.
23 Symbolic names (variables) are written in <i>italic</i> letters.
26 Directories are marked with a trailing / and <b>bold</b> letters.
28 Scripts are marked with a trailing superscript <sup>*</sup>.
30 Hash files (with key/value pairs) are marked with a trailing superscript <sup>#</sup>.
32 Boolean files (without content) are marked with a trailing superscript <sup>0</sup>.
34 Scalar files (with only one line) are marked with a trailing superscript <sup>1</sup>.
36 List files (with multiple lines) are marked with a trailing superscript <sup>min - max</sup> sequence, where min is the minimum and max the maximum number of lines.
38 Symlinks are marked with a trailing superscript <sup>@</sup>.
40 Data files have no special mark up.
42 Symbolic names (variables) are written in <i>italic</i> letters.
46 <xsl:call-template name="collection">
47 <xsl:with-param name="thisdir"><xsl:value-of select="$confdir"/></xsl:with-param>
51 <xsl:template name="collection">
52 <xsl:param name="thisdir"/>
53 <xsl:if test="count(scalar) + count(link) + count(program) + count(data) + count(hash) + count(list) + count(boolean) + count(collection)>0">
55 <xsl:if test="@id"><span><xsl:attribute name="id"><xsl:value-of select="@id" /></xsl:attribute></span></xsl:if>
56 <xsl:call-template name="dir-iterate">
57 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
63 <xsl:template name="dir-iterate">
64 <xsl:param name="thisdir"/>
65 <xsl:apply-templates select="scalar|link|program|data|hash|list|boolean">
66 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
67 <xsl:sort select="@name"/>
68 </xsl:apply-templates>
70 <xsl:apply-templates select="collection">
71 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
72 <xsl:sort select="@name"/>
73 </xsl:apply-templates>
76 <xsl:template match="program">
77 <xsl:param name="thisdir"/>
79 <xsl:call-template name="printname">
80 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
81 <xsl:with-param name="style">script</xsl:with-param>
83 <xsl:call-template name="printcontent"/>
87 <xsl:template match="hash">
88 <xsl:param name="thisdir"/>
90 <xsl:call-template name="printname">
91 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
92 <xsl:with-param name="style">hash</xsl:with-param>
94 <xsl:call-template name="printcontent"/>
98 <xsl:template match="scalar">
99 <xsl:param name="thisdir"/>
101 <xsl:call-template name="printname">
102 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
103 <xsl:with-param name="style">file</xsl:with-param>
105 <xsl:call-template name="printcontent"/>
109 <xsl:template match="data">
110 <xsl:param name="thisdir"/>
112 <xsl:call-template name="printname">
113 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
114 <xsl:with-param name="style">data</xsl:with-param>
116 <xsl:call-template name="printcontent"/>
120 <xsl:template match="list">
121 <xsl:param name="thisdir"/>
123 <xsl:call-template name="printname">
124 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
125 <xsl:with-param name="style">list</xsl:with-param>
127 <xsl:call-template name="printcontent"/>
131 <xsl:template match="link">
132 <xsl:param name="thisdir"/>
134 <xsl:call-template name="printname">
135 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
136 <xsl:with-param name="style">symlink</xsl:with-param>
138 <xsl:call-template name="printcontent"/>
142 <xsl:template match="boolean">
143 <xsl:param name="thisdir"/>
145 <xsl:call-template name="printname">
146 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
147 <xsl:with-param name="style">boolean</xsl:with-param>
149 <xsl:call-template name="printcontent"/>
153 <xsl:template match="collection">
154 <xsl:param name="thisdir"/>
156 <xsl:call-template name="printname">
157 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/></xsl:with-param>
158 <xsl:with-param name="style">directory</xsl:with-param>
160 <xsl:call-template name="printcontent"/>
162 <xsl:call-template name="collection">
163 <xsl:with-param name="thisdir"><xsl:value-of select="$thisdir"/>/<xsl:call-template name="printdirname"/></xsl:with-param>
168 <xsl:template match="collection" mode="printrpath">
169 <xsl:text>/</xsl:text>
170 <span class="{@type}">
171 <xsl:value-of select="@name"/>
175 <xsl:template name="printname">
176 <xsl:param name="thisdir"/>
177 <xsl:param name="style"/>
178 <xsl:if test="@id"><span><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute></span></xsl:if>
179 <xsl:if test="$style = 'directory'">'''</xsl:if>
180 <xsl:value-of select="$thisdir"/>/<xsl:if test="@type = 'symbolic'">''</xsl:if><xsl:value-of select="@name"/><xsl:if test="@type = 'symbolic'">''</xsl:if>
182 <xsl:when test="$printstylename = 'true'">
183 <xsl:if test="$style = 'directory'">'''</xsl:if>
184 <xsl:value-of select="concat(' [',$style,']')"/>
188 <xsl:when test="$style = 'directory'">/'''</xsl:when>
189 <xsl:when test="$style = 'symlink'"><sup>@</sup></xsl:when>
190 <xsl:when test="$style = 'boolean'"><sup>0</sup></xsl:when>
191 <xsl:when test="$style = 'list'"><sup><xsl:choose>
192 <xsl:when test="minElements"><xsl:value-of select="minElements"/></xsl:when>
193 <xsl:otherwise>0</xsl:otherwise>
194 </xsl:choose><xsl:value-of select="0 + minElements"/>-<xsl:choose>
195 <xsl:when test="maxElements"><xsl:value-of select="maxElements"/></xsl:when>
196 <xsl:otherwise>∞</xsl:otherwise>
197 </xsl:choose></sup></xsl:when>
198 <xsl:when test="$style = 'file'"><sup>1</sup></xsl:when>
199 <xsl:when test="$style = 'script'"><sup>*</sup></xsl:when>
200 <xsl:when test="$style = 'hash'"><sup>#</sup></xsl:when>
201 <xsl:when test="$style = 'data'"></xsl:when>
202 <xsl:otherwise><sup>???</sup></xsl:otherwise>
208 <xsl:template name="printcontent">
210 <xsl:apply-templates select="description"/>
211 <xsl:call-template name="since"/>
212 <xsl:apply-templates select="default"/>
213 <xsl:call-template name="default"/>
214 <xsl:if test="$printstylename = 'true'">
215 <xsl:apply-templates select="minElements"/>
216 <xsl:apply-templates select="maxElements"/>
218 <xsl:apply-templates select="restriction"/>
219 <xsl:apply-templates select="elements"/>
220 <xsl:apply-templates select="parameterList"/>
221 <xsl:apply-templates select="keys"/>
224 <!-- Extra content for scalar nodes -->
226 <xsl:template match="restriction">
230 <xsl:apply-templates select="enumeration">
231 <xsl:sort select="@value"/>
232 </xsl:apply-templates>
237 <xsl:template match="restriction/enumeration">
238 <xsl:value-of select="concat(' ; ',@value)"/>
241 <!-- Extra content for hash nodes -->
243 <xsl:template match="keys">
246 <xsl:apply-templates select="key">
247 <xsl:sort select="@name"/>
248 </xsl:apply-templates>
253 <xsl:template match="keys/key">
254 <xsl:value-of select="concat(' ; ',@name,' : ',replace(description,'[\r\n]+',' '))"/>
257 <!-- Extra content for list nodes -->
258 <xsl:template match="minElements">
261 <xsl:value-of select="concat(' ; minimum number of Elements : ',replace('[\r\n]+',' '))"/>
266 <xsl:template match="maxElements">
269 <xsl:value-of select="concat(' ; maximum number of Elements : ',replace('[\r\n]+',' '))"/>
274 <xsl:template match="elements">
278 <xsl:apply-templates select="element">
279 <xsl:sort select="@name"/>
280 </xsl:apply-templates>
285 <xsl:template match="elements/element">
286 <xsl:value-of select="concat(' ; ',@name,' : ',replace(description,'[\r\n]+',' '))"/>
289 <!-- Extra content for program nodes -->
291 <xsl:template match="parameterList">
294 Will be called with the following parameters:
295 <xsl:apply-templates select="parameter"/>
300 <xsl:template match="parameterList/parameter">
301 <xsl:value-of select="concat(' ; ',@name,' : ',replace(description,'[\r\n]+',' '))"/>
304 <!-- Extra content for all nodes -->
306 <xsl:template match="default">
307 <ul><ul><xsl:value-of select="concat(' ; Default : ',replace(.,'[\r\n]+',' '))"/></ul></ul>
310 <xsl:template name="default"><xsl:if test="@default">
311 <ul><ul> ; Default : <xsl:value-of select="@default"/></ul></ul>
312 </xsl:if></xsl:template>"
314 <xsl:template name="since"><xsl:if test="@since">
315 <ul><ul> ; Since Version : <xsl:value-of select="@since"/></ul></ul>
316 </xsl:if></xsl:template>
320 <xsl:template name="printdirname"><xsl:if test="@type='symbolic'">''</xsl:if><xsl:value-of select="@name"/><xsl:if test="@type='symbolic'">''</xsl:if></xsl:template>
321 <xsl:template match="description"><xsl:apply-templates/></xsl:template>
322 <xsl:template match="ulink">[<xsl:value-of select="@url"/><xsl:value-of select="concat(' ',replace(.,'[\r\n]+',' '))"/>]</xsl:template>
323 <xsl:template match="br"><br /></xsl:template>
324 <xsl:template match="p"><div><xsl:apply-templates/></div></xsl:template>
325 <xsl:template match="tool"><code><xsl:apply-templates/></code></xsl:template>
326 <xsl:template match="command"><code><xsl:apply-templates/></code></xsl:template>
327 <xsl:template match="directory"><xsl:apply-templates/></xsl:template>
328 <xsl:template match="optionref">[[#<xsl:choose>
329 <xsl:when test="@ref"><xsl:value-of select="@ref"/></xsl:when>
330 <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
331 </xsl:choose>|<xsl:apply-templates/>]]</xsl:template>
333 <xsl:template match="filename">[file://<xsl:value-of select="text()"/>]</xsl:template>