3 Generate Docbook/XML file with attributions based on chapter/author tags
4 (C) Jelmer Vernooij 2003
6 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
9 <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"/>
11 <!-- Remove all character data -->
12 <xsl:template match=
"@*|node()">
13 <xsl:apply-templates select=
"@*|node()"/>
16 <xsl:template match=
"/">
17 <xsl:element name=
"preface">
18 <xsl:element name=
"title"><xsl:text>Attribution
</xsl:text></xsl:element>
19 <xsl:apply-templates/>
23 <xsl:template match=
"chapter|preface">
25 <xsl:when test=
"chapterinfo/author != ''">
26 <xsl:element name=
"para">
27 <xsl:element name=
"link">
28 <xsl:attribute name=
"linkend"><xsl:value-of select=
"@id"/></xsl:attribute>
29 <xsl:value-of select=
"title"/>
31 <xsl:text> 	</xsl:text>
32 <xsl:element name=
"itemizedlist">
33 <xsl:apply-templates/>
34 <xsl:text>	</xsl:text>
36 <xsl:text> </xsl:text>
42 <xsl:template match=
"chapterinfo/author">
44 <xsl:when test=
"firstname != ''">
45 <xsl:text>	</xsl:text>
46 <xsl:element name=
"listitem">
47 <xsl:element name=
"para">
48 <xsl:value-of select=
"firstname"/>
49 <xsl:if test=
"othername != ''">
50 <xsl:text> </xsl:text>
51 <xsl:value-of select=
"othername"/>
52 <xsl:text> </xsl:text>
54 <xsl:text> </xsl:text><xsl:value-of select=
"surname"/>
56 <xsl:when test=
"affiliation/address/email != ''">
57 <xsl:element name=
"ulink">
58 <xsl:attribute name=
"noescape">
59 <xsl:text>1</xsl:text>
61 <xsl:attribute name=
"url">
62 <xsl:text>mailto:
</xsl:text>
63 <xsl:value-of select=
"affiliation/address/email"/>
69 <xsl:when test=
"contrib != ''">
70 <xsl:text> (
</xsl:text>
71 <xsl:value-of select=
"contrib"/>
72 <xsl:text>)
</xsl:text>
77 <xsl:text> </xsl:text>