Add new framework for smb.conf(5). Please read README before trying to compile.
[Samba/gebeck_regimport.git] / docs / docbook / smbdotconf / expand-smb.conf.xsl
blob87b4898cf736f87d082e9eb2ea4b3f543003c879
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">
9 <xsl:output method="xml"/>
11 <!-- Generates one big XML file for smb.conf -->
13 <xsl:param name="xmlSambaNsUri" select="'http://samba.org/common'"/>
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>
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>
33 <xsl:variable name="name"><xsl:value-of select="translate(translate(string(@name),' ',''),
34 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
35 </xsl:variable>
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>
45 <xsl:variable name="context">
46 <xsl:text> (</xsl:text>
47 <xsl:value-of select="@context"/>
48 <xsl:text>)</xsl:text>
49 </xsl:variable>
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>
59 <xsl:variable name="content">
60 <xsl:apply-templates/>
61 </xsl:variable>
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>
72 </xsl:template>
74 </xsl:stylesheet>