3 Generate Docbook/XML file with attributions based on chapter/author tags
4 (C) Jelmer Vernooij 2003
6 Published under the GNU GPLv3 or later
8 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
11 <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"/>
13 <!-- Remove all character data -->
14 <xsl:template match=
"@*|node()">
15 <xsl:apply-templates select=
"@*|node()"/>
18 <xsl:template match=
"/">
19 <xsl:element name=
"preface">
20 <xsl:element name=
"title"><xsl:text>Attribution
</xsl:text></xsl:element>
21 <xsl:apply-templates/>
25 <xsl:template match=
"chapter|preface">
27 <xsl:when test=
"chapterinfo/author != ''">
28 <xsl:element name=
"para">
29 <xsl:element name=
"link">
30 <xsl:attribute name=
"linkend"><xsl:value-of select=
"@id"/></xsl:attribute>
31 <xsl:value-of select=
"title"/>
33 <xsl:text> 	</xsl:text>
34 <xsl:element name=
"itemizedlist">
35 <xsl:apply-templates/>
36 <xsl:text>	</xsl:text>
38 <xsl:text> </xsl:text>
44 <xsl:template match=
"chapterinfo/author">
46 <xsl:when test=
"firstname != ''">
47 <xsl:text>	</xsl:text>
48 <xsl:element name=
"listitem">
49 <xsl:element name=
"para">
50 <xsl:value-of select=
"firstname"/>
51 <xsl:if test=
"othername != ''">
52 <xsl:text> </xsl:text>
53 <xsl:value-of select=
"othername"/>
54 <xsl:text> </xsl:text>
56 <xsl:text> </xsl:text><xsl:value-of select=
"surname"/>
58 <xsl:when test=
"affiliation/address/email != ''">
59 <xsl:element name=
"ulink">
60 <xsl:attribute name=
"noescape">
61 <xsl:text>1</xsl:text>
63 <xsl:attribute name=
"url">
64 <xsl:text>mailto:
</xsl:text>
65 <xsl:value-of select=
"affiliation/address/email"/>
71 <xsl:when test=
"contrib != ''">
72 <xsl:text> (
</xsl:text>
73 <xsl:value-of select=
"contrib"/>
74 <xsl:text>)
</xsl:text>
79 <xsl:text> </xsl:text>