diff options
author | cvs2svn Import User <samba-bugs@samba.org> | 2003-03-27 23:02:44 +0000 |
---|---|---|
committer | cvs2svn Import User <samba-bugs@samba.org> | 2003-03-27 23:02:44 +0000 |
commit | 00934b5d0062fce3fbaffabde6d5c10b8447f369 (patch) | |
tree | 6670361d5f232ecc7fd0906a9deabfad0b38a565 /docs/docbook/smbdotconf/split-original-smb.conf.xsl | |
parent | 9676bf7e5c400dab8ee806ea77459e313fdbfe95 (diff) | |
parent | c321404feb40e6eaaae4564c5c81b8b644bba3f7 (diff) | |
download | samba-00934b5d0062fce3fbaffabde6d5c10b8447f369.tar.gz samba-00934b5d0062fce3fbaffabde6d5c10b8447f369.tar.bz2 samba-00934b5d0062fce3fbaffabde6d5c10b8447f369.zip |
This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to be commit 6cd4d3f39a1258d51c022c99c73a7341b0ff94a5)
Diffstat (limited to 'docs/docbook/smbdotconf/split-original-smb.conf.xsl')
-rw-r--r-- | docs/docbook/smbdotconf/split-original-smb.conf.xsl | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/docs/docbook/smbdotconf/split-original-smb.conf.xsl b/docs/docbook/smbdotconf/split-original-smb.conf.xsl new file mode 100644 index 0000000000..7a6a2b920a --- /dev/null +++ b/docs/docbook/smbdotconf/split-original-smb.conf.xsl @@ -0,0 +1,78 @@ +<?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"/> + +<xsl:param name="output.dir.name" select="'test/'"/> + +<!-- This is needed to copy content unchanged --> +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> +</xsl:template> + +<!-- 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="varlistentry"> + <xsl:variable name="output.dir.name" select="$output.dir.name"/> + <!-- Extract anchor's 'id' and translate it to lower case --> + <xsl:variable name="fname"> + <xsl:value-of select="translate(string(term/anchor/@id), + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/> + </xsl:variable> + <!-- 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:choose> + <xsl:when test="$fname != ''"> + <!-- full file name --> + <xsl:variable name="filename"><xsl:value-of select="$output.dir.name"/><xsl:value-of select="$fname"/>.xml</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:text> for </xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:if test="term/anchor/@id"> + <xsl:text>(</xsl:text> + <xsl:value-of select="term/anchor/@id"/> + <xsl:text>)</xsl:text> + </xsl:if> + </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:element name="samba:parameter"> + <xsl:copy-of select="$content"/> + </xsl:element> + </exsl:document> + <xsl:text disable-output-escaping="yes">&smb.</xsl:text> + <xsl:value-of select="$fname"/> + <xsl:text>;</xsl:text> + </xsl:when> + <!-- this was a varlistentry w/o anchor associated, just dump it to the main document --> + <xsl:otherwise> + <xsl:element name="varlistentry"> + <xsl:copy-of select="$content"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> |