~ubuntu-branches/ubuntu/raring/kbibtex/raring

« back to all changes in this revision

Viewing changes to xslt/standard.xsl

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2011-07-18 09:29:48 UTC
  • mfrom: (1.1.6) (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20110718092948-ksxjmg7kdfamolmg
Tags: 0.3-1
* First upstream release for KDE4 (Closes: #634255). A number of search
  engines are still missing, in comparison to the 0.2 series.
* Bumped Standards-Version to 3.9.2, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
 
2
 
 
3
<!--
 
4
  - This Extensible Stylesheet Language Transformation file translates XML files
 
5
  - as generated by KBibTeX into nice HTML code.
 
6
  -
 
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.
 
9
  -->
 
10
 
 
11
<xsl:output omit-xml-declaration="yes" indent="no" encoding="UTF-8"/>
 
12
 
 
13
<!-- ==============================================================================
 
14
     Maintain original HTML tags
 
15
-->
 
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">
 
17
<xsl:copy>
 
18
<xsl:copy-of select="@*" />
 
19
<xsl:apply-templates />
 
20
</xsl:copy>
 
21
</xsl:template>
 
22
 
 
23
 
 
24
 
 
25
<xsl:template match="text">
 
26
<xsl:apply-templates />
 
27
</xsl:template>
 
28
 
 
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>
 
32
</xsl:template>
 
33
 
 
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>
 
37
</xsl:if>
 
38
<xsl:if test="position()=last()-1 and @etal!='true'">
 
39
<xsl:text> and </xsl:text>
 
40
</xsl:if>
 
41
</xsl:for-each>
 
42
<xsl:if test="@etal='true'"><xsl:text> </xsl:text><i>et&#160;al.</i></xsl:if>
 
43
<xsl:text>: </xsl:text>
 
44
</xsl:template>
 
45
 
 
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>
 
50
</xsl:if>
 
51
<xsl:if test="position()=last()-1 and @etal!='true'"><xsl:text> and </xsl:text></xsl:if>
 
52
</xsl:for-each>
 
53
<xsl:if test="@etal='true'"><xsl:text> </xsl:text><i>et&#160;al.</i></xsl:if>
 
54
</xsl:template>
 
55
 
 
56
<xsl:template match="title">
 
57
<b><xsl:apply-templates /></b>
 
58
</xsl:template>
 
59
 
 
60
<xsl:template match="booktitle">
 
61
<xsl:text>, </xsl:text><i><xsl:apply-templates /></i>
 
62
</xsl:template>
 
63
 
 
64
<xsl:template match="school">
 
65
<xsl:text>, </xsl:text><xsl:apply-templates />
 
66
</xsl:template>
 
67
 
 
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>
 
78
</xsl:if>
 
79
</xsl:if>
 
80
</xsl:template>
 
81
 
 
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"/>
 
88
</xsl:if>
 
89
</xsl:template>
 
90
 
 
91
<xsl:template match="publisher">
 
92
<xsl:text>, </xsl:text>
 
93
<xsl:apply-templates />
 
94
</xsl:template>
 
95
 
 
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 />
 
103
</xsl:if>
 
104
</xsl:template>
 
105
 
 
106
<xsl:template match="edition">
 
107
<xsl:text>, </xsl:text>
 
108
<xsl:apply-templates />
 
109
<xsl:text> edition</xsl:text>
 
110
</xsl:template>
 
111
 
 
112
<xsl:template match="pages">
 
113
<xsl:text>, </xsl:text>
 
114
<xsl:apply-templates />
 
115
</xsl:template>
 
116
 
 
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>
 
122
</xsl:if>
 
123
<xsl:apply-templates />
 
124
</xsl:template>
 
125
 
 
126
<xsl:template match="note">
 
127
<xsl:text>, </xsl:text><xsl:apply-templates />
 
128
</xsl:template>
 
129
 
 
130
<xsl:template match="abstract">
 
131
<br/><small><i>Abstract</i><xsl:text>: </xsl:text><xsl:apply-templates /></small>
 
132
</xsl:template>
 
133
 
 
134
<xsl:template match="entry">
 
135
<p>
 
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" />
 
150
</p>
 
151
</xsl:template>
 
152
 
 
153
<xsl:template match="bibliography">
 
154
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
155
<head>
 
156
<title>Bibliography</title>
 
157
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 
158
</head>
 
159
<body>
 
160
<xsl:apply-templates select="entry" />
 
161
</body>
 
162
</html>
 
163
</xsl:template>
 
164
 
 
165
</xsl:stylesheet>