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"
7 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"
10 <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
12 <!-- Remove all character data -->
13 <xsl:template match="@*|node()">
14 <xsl:apply-templates select="@*|node()"/>
17 <xsl:template match="/">
18 <xsl:element name="preface">
19 <xsl:element name="title"><xsl:text>Attribution</xsl:text></xsl:element>
20 <xsl:apply-templates/>
24 <xsl:template match="chapter|preface">
26 <xsl:when test="chapterinfo/author != ''">
27 <xsl:element name="para">
28 <xsl:element name="link">
29 <xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute>
30 <xsl:value-of select="title"/>
32 <xsl:text> 	</xsl:text>
33 <xsl:element name="itemizedlist">
34 <xsl:apply-templates/>
35 <xsl:text>	</xsl:text>
37 <xsl:text> </xsl:text>
43 <xsl:template match="chapterinfo/author">
45 <xsl:when test="firstname != ''">
46 <xsl:text>	</xsl:text>
47 <xsl:element name="listitem">
48 <xsl:element name="para">
49 <xsl:value-of select="firstname"/>
50 <xsl:if test="othername != ''">
51 <xsl:text> </xsl:text>
52 <xsl:value-of select="othername"/>
53 <xsl:text> </xsl:text>
55 <xsl:text> </xsl:text><xsl:value-of select="surname"/>
57 <xsl:when test="affiliation/address/email != ''">
58 <xsl:text> <</xsl:text>
59 <xsl:element name="ulink">
60 <xsl:attribute name="samba: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"/>
67 <xsl:value-of select="affiliation/address/email"/>
69 <xsl:text>></xsl:text>
73 <xsl:when test="contrib != ''">
74 <xsl:text> (</xsl:text>
75 <xsl:value-of select="contrib"/>
76 <xsl:text>) </xsl:text>
81 <xsl:text> </xsl:text>