1
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
4
- This Extensible Stylesheet Language Transformation file translates XML files
5
- as generated by KBibTeX into nice HTML code.
7
- This file was written by Thomas Fischer <fischer@unix-ag.uni-kl.de>
8
- It is released under the GNU Public License version 2 or later.
11
<xsl:output omit-xml-declaration="yes" indent="no" encoding="UTF-8"/>
13
<!-- ==============================================================================
14
Maintain original HTML tags
16
<xsl:template match="a|abbr|acronym|address|applet|b|big|blockquote|br|cite|code|del|dfn|div|em|hr|i|kbd|p|param|pre|q|quote|samp|script|span|small|strike|strong|sub|sup|tt|var|button|fieldset|form|input|label|legend|object|option|optgroup|select|caption|col|colgroup|table|tbody|td|tfoot|th|thead|tr|dl|dd|dt|ol|ul|li|img|quote|quotation" xmlns:html="http://www.w3.org/1999/XSL/some">
18
<xsl:copy-of select="@*" />
19
<xsl:apply-templates />
25
<xsl:template match="text">
26
<xsl:apply-templates />
29
<xsl:template match="person">
30
<xsl:value-of select="lastname"/><xsl:if test="string-length(firstname)>0"><xsl:text>, </xsl:text>
31
<xsl:value-of select="firstname"/></xsl:if>
34
<xsl:template match="authors">
35
<xsl:for-each select="person">
36
<xsl:apply-templates select="."/><xsl:if test="position()!=last()"><xsl:text>, </xsl:text>
38
<xsl:if test="position()=last()-1 and @etal!='true'">
39
<xsl:text> and </xsl:text>
42
<xsl:if test="@etal='true'"><xsl:text> </xsl:text><i>et al.</i></xsl:if>
43
<xsl:text>: </xsl:text>
46
<xsl:template match="editors">
47
<xsl:text>, Eds: </xsl:text>
48
<xsl:for-each select="person">
49
<xsl:apply-templates select="."/><xsl:if test="position()!=last()"><xsl:text>, </xsl:text>
51
<xsl:if test="position()=last()-1 and @etal!='true'"><xsl:text> and </xsl:text></xsl:if>
53
<xsl:if test="@etal='true'"><xsl:text> </xsl:text><i>et al.</i></xsl:if>
56
<xsl:template match="title">
57
<b><xsl:apply-templates /></b>
60
<xsl:template match="booktitle">
61
<xsl:text>, </xsl:text><i><xsl:apply-templates /></i>
64
<xsl:template match="school">
65
<xsl:text>, </xsl:text><xsl:apply-templates />
68
<xsl:template match="journal">
69
<xsl:text>, </xsl:text>
70
<i><xsl:apply-templates /></i>
71
<xsl:if test="string-length(../volume)>0">
72
<xsl:text> </xsl:text>
73
<xsl:value-of select="../volume"/>
74
<xsl:if test="string-length(../number)>0">
75
<xsl:text>(</xsl:text>
76
<xsl:value-of select="../number"/>
77
<xsl:text>)</xsl:text>
82
<xsl:template match="institution">
83
<xsl:text>, </xsl:text>
84
<i><xsl:apply-templates /></i>
85
<xsl:if test="string-length(../number)>0">
86
<xsl:text> No. </xsl:text>
87
<xsl:value-of select="../number"/>
91
<xsl:template match="publisher">
92
<xsl:text>, </xsl:text>
93
<xsl:apply-templates />
96
<xsl:template match="volume">
97
<xsl:if test="string-length(../journal)=0">
98
<!-- do not print volume if there is "journal" field,
99
which prints the volume, too. -->
100
<xsl:text>, </xsl:text>
101
<xsl:text>volume </xsl:text>
102
<xsl:apply-templates />
106
<xsl:template match="edition">
107
<xsl:text>, </xsl:text>
108
<xsl:apply-templates />
109
<xsl:text> edition</xsl:text>
112
<xsl:template match="pages">
113
<xsl:text>, </xsl:text>
114
<xsl:apply-templates />
117
<xsl:template match="year">
118
<xsl:text>, </xsl:text>
119
<xsl:if test="string-length(../month)>0">
120
<xsl:value-of select="../month"/>
121
<xsl:text> </xsl:text>
123
<xsl:apply-templates />
126
<xsl:template match="note">
127
<xsl:text>, </xsl:text><xsl:apply-templates />
130
<xsl:template match="abstract">
131
<br/><small><i>Abstract</i><xsl:text>: </xsl:text><xsl:apply-templates /></small>
134
<xsl:template match="entry">
136
<xsl:apply-templates select="authors" />
137
<xsl:apply-templates select="title" />
138
<xsl:apply-templates select="booktitle" />
139
<xsl:apply-templates select="journal" />
140
<xsl:apply-templates select="school" />
141
<xsl:apply-templates select="volume" />
142
<xsl:apply-templates select="edition" />
143
<xsl:apply-templates select="publisher" />
144
<xsl:apply-templates select="institution" />
145
<xsl:apply-templates select="pages" />
146
<xsl:apply-templates select="editors" />
147
<xsl:apply-templates select="year" />
148
<xsl:apply-templates select="note" />
149
<xsl:apply-templates select="abstract" />
153
<xsl:template match="bibliography">
154
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
156
<title>Bibliography</title>
157
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
160
<xsl:apply-templates select="entry" />