Doc updates from John + some minor fixes by me
[samba.git] / docs / docbook / smbdotconf / expand-smb.conf.xsl
1 <?xml version='1.0'?>
2 <!-- vim:set sts=2 shiftwidth=2 syntax=xml: -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 xmlns:exsl="http://exslt.org/common"
5                 xmlns:samba="http://samba.org/common"
6                 version="1.1"
7                 extension-element-prefixes="exsl">
8
9 <xsl:output method="xml"/>
10
11 <!-- Generates one big XML file for smb.conf -->
12
13 <xsl:param name="xmlSambaNsUri" select="'http://samba.org/common'"/>
14
15 <!-- This is needed to copy content unchanged -->
16 <xsl:template match="@*|node()">
17   <xsl:copy>
18     <xsl:apply-templates select="@*|node()"/>
19   </xsl:copy>
20 </xsl:template>
21
22
23 <xsl:template match="//samba:parameter">
24   <!-- reconstruct varlistentry - not all of them will go into separate files
25        and also we must repair the main varlistentry itself.
26   -->
27       <xsl:message>
28         <xsl:text>Processing samba:parameter (</xsl:text>
29         <xsl:value-of select="@name"/>
30         <xsl:text>)</xsl:text>
31       </xsl:message>
32
33   <xsl:variable name="name"><xsl:value-of select="translate(translate(string(@name),' ',''),
34                   'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
35   </xsl:variable>
36   
37   <xsl:variable name="anchor">
38      <xsl:element name="anchor">
39         <xsl:attribute name="id">
40           <xsl:value-of select="$name"/>
41         </xsl:attribute>
42      </xsl:element>
43   </xsl:variable>
44
45   <xsl:variable name="context">
46      <xsl:text> (</xsl:text>
47      <xsl:value-of select="@context"/>
48      <xsl:text>)</xsl:text>
49   </xsl:variable>
50
51   <xsl:variable name="term">
52      <xsl:element name="term">
53           <xsl:copy-of select="$anchor"/>
54           <xsl:value-of select="@name"/>
55           <xsl:value-of select="$context"/>
56      </xsl:element>
57   </xsl:variable>
58
59   <xsl:variable name="content">
60        <xsl:apply-templates/>
61   </xsl:variable>
62   
63   <xsl:element name="varlistentry">
64      <xsl:text>
65 </xsl:text>     
66      <xsl:copy-of select="$term"/>
67      <xsl:copy-of select="$content"/>
68      <xsl:text>
69 </xsl:text>     
70   </xsl:element>
71
72 </xsl:template>
73
74 </xsl:stylesheet>