3 Extract examples out of DocBook/XML file
4 (C) Jelmer Vernooij 2003
6 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
7 xmlns:
exsl=
"http://exslt.org/common"
8 xmlns:
samba=
"http://www.samba.org/samba/DTD/samba-doc"
10 extension-element-prefixes=
"exsl">
12 <xsl:output method=
"xml"/>
14 <xsl:template match=
"example/title"></xsl:template>
16 <xsl:template match=
"example/simplelist/title"></xsl:template>
18 <!-- Parse all varlistentries and extract those of them which are descriptions of smb.conf
19 parameters. We determine them by existence of <anchor> element inside <term> element.
20 If <anchor> is there, then its 'id' attribute is translated to lower case and is used
21 as basis for file name for that parameter.
23 <xsl:template match=
"example">
24 <!-- reconstruct varlistentry - not all of them will go into separate files
25 and also we must repair the main varlistentry itself.
27 <xsl:variable name=
"content">
28 <xsl:apply-templates/>
30 <!-- Now put varlistentry into separate file _if_ it has anchor associated with it -->
31 <xsl:variable name=
"filename"><xsl:text>examples/
</xsl:text><xsl:value-of select=
"@id"/>.conf
</xsl:variable>
32 <!-- Debug message for an operator, just to show progress of processing :) -->
34 <xsl:text>Writing
</xsl:text>
35 <xsl:value-of select=
"$filename"/>
36 <xsl:text> for
</xsl:text>
37 <xsl:value-of select=
"title"/>
39 <!-- Write finally varlistentry to a separate file -->
40 <exsl:document href=
"{$filename}"
44 omit-xml-declaration=
"yes">
45 <xsl:copy-of select=
"$content"/>