diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-04-11 18:54:15 +0000 |
---|---|---|
committer | Gerald W. Carter <jerry@samba.org> | 2008-04-23 08:45:47 -0500 |
commit | 15829f6a9fb29f15845ac3a299a1994e7edf0de7 (patch) | |
tree | d4b55c25b6c68f66cfd759f6c1497e679e348772 /docs/xslt/extract-smbfiles.xsl | |
parent | 71c7aff70da232a3382ae0f1803a8e700e0784e6 (diff) | |
download | samba-15829f6a9fb29f15845ac3a299a1994e7edf0de7.tar.gz samba-15829f6a9fb29f15845ac3a299a1994e7edf0de7.tar.bz2 samba-15829f6a9fb29f15845ac3a299a1994e7edf0de7.zip |
Add script for extracting additional files
(This used to be commit b41c38e8df138eca806e4c04a6d48059d9b03ca7)
Diffstat (limited to 'docs/xslt/extract-smbfiles.xsl')
-rw-r--r-- | docs/xslt/extract-smbfiles.xsl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/xslt/extract-smbfiles.xsl b/docs/xslt/extract-smbfiles.xsl new file mode 100644 index 0000000000..1533980145 --- /dev/null +++ b/docs/xslt/extract-smbfiles.xsl @@ -0,0 +1,41 @@ +<?xml version='1.0'?> +<!-- vim:set sts=2 shiftwidth=2 syntax=xml: --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns:samba="http://samba.org/common" + version="1.1" + extension-element-prefixes="exsl"> + +<xsl:output method="xml"/> + +<!-- Parse all varlistentries and extract those of them which are descriptions of smb.conf + parameters. We determine them by existence of <anchor> element inside <term> element. + If <anchor> is there, then its 'id' attribute is translated to lower case and is used + as basis for file name for that parameter. +--> +<xsl:template match="smbfile"> + <!-- reconstruct varlistentry - not all of them will go into separate files + and also we must repair the main varlistentry itself. + --> + <xsl:variable name="content"> + <xsl:apply-templates/> + </xsl:variable> + <!-- Now put varlistentry into separate file _if_ it has anchor associated with it --> + <xsl:variable name="filename"><xsl:text>examples/</xsl:text><xsl:value-of select="@name"/></xsl:variable> + <!-- Debug message for an operator, just to show progress of processing :) --> + <xsl:message> + <xsl:text>Writing </xsl:text> + <xsl:value-of select="$filename"/> + </xsl:message> + <!-- Write finally varlistentry to a separate file --> + <exsl:document href="{$filename}" + method="xml" + encoding="UTF-8" + indent="yes" + omit-xml-declaration="yes"> + <xsl:copy-of select="$content"/> + </exsl:document> +</xsl:template> + +</xsl:stylesheet> + |