Update DTD location. Fixes smb.conf.5 build.
[import/samba-docs-svnimport.git] / xslt / extract-smbfiles.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://www.samba.org/samba/DTD/samba-doc"
6                 version="1.1"
7                 extension-element-prefixes="exsl">
8
9 <xsl:output method="xml"/>
10
11 <!-- Parse all varlistentries and extract those of them which are descriptions of smb.conf
12      parameters. We determine them by existence of <anchor> element inside <term> element.
13      If <anchor> is there, then its 'id' attribute is translated to lower case and is used
14      as basis for file name for that parameter.
15 -->
16 <xsl:template match="smbfile">
17         <!-- reconstruct varlistentry - not all of them will go into separate files
18         and also we must repair the main varlistentry itself.
19         -->
20         <xsl:variable name="content">
21                 <xsl:apply-templates/>
22         </xsl:variable>
23         <!-- Now put varlistentry into separate file _if_ it has anchor associated with it -->
24         <xsl:variable name="filename"><xsl:text>output/examples/</xsl:text><xsl:value-of select="@name"/></xsl:variable>
25         <!-- Debug message for an operator, just to show progress of processing :) -->
26         <xsl:message>
27                 <xsl:text>Writing </xsl:text>
28                 <xsl:value-of select="$filename"/>
29         </xsl:message>
30         <!-- Write finally varlistentry to a separate file -->
31         <exsl:document href="{$filename}" 
32                 method="xml" 
33                 encoding="UTF-8" 
34                 indent="yes"
35                 omit-xml-declaration="yes">
36                 <xsl:copy-of select="$content"/>
37         </exsl:document>
38 </xsl:template>
39
40 </xsl:stylesheet>
41