diff options
author | Gerald W. Carter <jerry@samba.org> | 2008-04-22 10:09:40 -0500 |
---|---|---|
committer | Gerald W. Carter <jerry@samba.org> | 2008-04-23 08:47:48 -0500 |
commit | 8f8a9f01909ba29e2b781310baeeaaddc3f15f0d (patch) | |
tree | 90c6b720ad3a7bc815245c0ef28820424f89d658 /docs-xml/xslt/generate-attributions.xsl | |
parent | 197238246389c40edc60c6630d18d6913086e630 (diff) | |
download | samba-8f8a9f01909ba29e2b781310baeeaaddc3f15f0d.tar.gz samba-8f8a9f01909ba29e2b781310baeeaaddc3f15f0d.tar.bz2 samba-8f8a9f01909ba29e2b781310baeeaaddc3f15f0d.zip |
Moving docs tree to docs-xml to make room for generated docs in the release tarball.
(This used to be commit 9f672c26d63955f613088489c6efbdc08b5b2d14)
Diffstat (limited to 'docs-xml/xslt/generate-attributions.xsl')
-rw-r--r-- | docs-xml/xslt/generate-attributions.xsl | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/docs-xml/xslt/generate-attributions.xsl b/docs-xml/xslt/generate-attributions.xsl new file mode 100644 index 0000000000..90e3e17568 --- /dev/null +++ b/docs-xml/xslt/generate-attributions.xsl @@ -0,0 +1,82 @@ +<?xml version='1.0'?> +<!-- + Generate Docbook/XML file with attributions based on chapter/author tags + (C) Jelmer Vernooij 2003 +--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.1"> + + <xsl:output method="xml" doctype-public="-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" doctype-system="http://www.samba.org/samba/DTD/samba-doc" indent="yes"/> + +<!-- Remove all character data --> +<xsl:template match="@*|node()"> + <xsl:apply-templates select="@*|node()"/> +</xsl:template> + +<xsl:template match="/"> + <xsl:element name="preface"> + <xsl:element name="title"><xsl:text>Attribution</xsl:text></xsl:element> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="chapter|preface"> + <xsl:choose> + <xsl:when test="chapterinfo/author != ''"> + <xsl:element name="para"> + <xsl:element name="link"> + <xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute> + <xsl:value-of select="title"/> + </xsl:element> + <xsl:text> 	</xsl:text> + <xsl:element name="itemizedlist"> + <xsl:apply-templates/> + <xsl:text>	</xsl:text> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:element> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="chapterinfo/author"> + <xsl:choose> + <xsl:when test="firstname != ''"> + <xsl:text>	</xsl:text> + <xsl:element name="listitem"> + <xsl:element name="para"> + <xsl:value-of select="firstname"/> + <xsl:if test="othername != ''"> + <xsl:text> </xsl:text> + <xsl:value-of select="othername"/> + <xsl:text> </xsl:text> + </xsl:if> + <xsl:text> </xsl:text><xsl:value-of select="surname"/> + <xsl:choose> + <xsl:when test="affiliation/address/email != ''"> + <xsl:element name="ulink"> + <xsl:attribute name="noescape"> + <xsl:text>1</xsl:text> + </xsl:attribute> + <xsl:attribute name="url"> + <xsl:text>mailto:</xsl:text> + <xsl:value-of select="affiliation/address/email"/> + </xsl:attribute> + </xsl:element> + </xsl:when> + </xsl:choose> + <xsl:choose> + <xsl:when test="contrib != ''"> + <xsl:text> (</xsl:text> + <xsl:value-of select="contrib"/> + <xsl:text>) </xsl:text> + </xsl:when> + </xsl:choose> + </xsl:element> + </xsl:element> + <xsl:text> </xsl:text> + </xsl:when> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> |