~paulbrianstewart/ubuntu/oneiric/tellico/852247-Formatting-Fix

« back to all changes in this revision

Viewing changes to xslt/unixref2tellico.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Regis Boudin
  • Date: 2008-05-23 21:28:59 UTC
  • mfrom: (0.1.14 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20080523212859-n0gl4ap37xb0uj1a
Tags: 1.3.2-1
* New upstream release.
* Recommend khelpcenter for acces to the help (Closes: #478975).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
3
                xmlns="http://periapsis.org/tellico/"
 
4
                xmlns:cr="http://www.crossref.org/xschema/1.0"
 
5
                xmlns:str="http://exslt.org/strings"
 
6
                xmlns:exsl="http://exslt.org/common"
 
7
                exclude-result-prefixes="cr"
 
8
                extension-element-prefixes="str exsl"
 
9
                version="1.0">
 
10
 
 
11
<!--
 
12
   ===================================================================
 
13
   Tellico XSLT file - used for importing data from crossref.org
 
14
   in the 'unixref' format.
 
15
 
 
16
   See http://www.crossref.org/schema/unixref1.0.xsd
 
17
 
 
18
   Copyright (C) 2008 Robby Stephenson - robby@periapsis.org
 
19
 
 
20
   This XSLT stylesheet is designed to be used with the 'Tellico'
 
21
   application, which can be found at http://www.periapsis.org/tellico/
 
22
 
 
23
   ===================================================================
 
24
-->
 
25
 
 
26
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
 
27
            doctype-public="-//Robby Stephenson/DTD Tellico V10.0//EN"
 
28
            doctype-system="http://periapsis.org/tellico/dtd/v10/tellico.dtd"/>
 
29
 
 
30
<!-- by default, don't output text -->
 
31
<xsl:template match="text()" />
 
32
 
 
33
<xsl:template match="/">
 
34
 <tellico syntaxVersion="10">
 
35
  <!-- always bibliography -->
 
36
  <collection title="CrossRef Import" type="5">
 
37
   <fields>
 
38
    <field name="_default"/>
 
39
    <xsl:if test=".//cr:issn">
 
40
     <field flags="0" title="ISSN" category="Publishing" format="4" type="1" name="issn" i18n="true"/>
 
41
    </xsl:if>
 
42
   </fields>
 
43
   <xsl:apply-templates select="cr:doi_records/cr:doi_record/cr:crossref"/>
 
44
  </collection>
 
45
 </tellico>
 
46
</xsl:template>
 
47
 
 
48
<xsl:template match="cr:crossref">
 
49
 <entry>
 
50
  <xsl:apply-templates/>
 
51
 </entry>
 
52
</xsl:template>
 
53
 
 
54
<xsl:template match="cr:book">
 
55
 <entry-type>book</entry-type>
 
56
 <xsl:apply-templates/>
 
57
</xsl:template>
 
58
 
 
59
<xsl:template match="cr:journal">
 
60
 <entry-type>article</entry-type>
 
61
 <xsl:apply-templates/>
 
62
</xsl:template>
 
63
 
 
64
<xsl:template match="cr:book_metadata">
 
65
 <title>
 
66
  <xsl:value-of select="cr:titles/cr:title[1]"/>
 
67
 </title>
 
68
 <xsl:apply-templates/>
 
69
</xsl:template>
 
70
 
 
71
<xsl:template match="cr:journal_article">
 
72
 <title>
 
73
  <xsl:value-of select="cr:titles/cr:title[1]"/>
 
74
 </title>
 
75
 <xsl:apply-templates/>
 
76
</xsl:template>
 
77
 
 
78
<xsl:template match="cr:isbn">
 
79
 <isbn>
 
80
  <xsl:value-of select="."/>
 
81
 </isbn>
 
82
</xsl:template>
 
83
 
 
84
<xsl:template match="cr:issn">
 
85
 <issn>
 
86
  <xsl:value-of select="."/>
 
87
 </issn>
 
88
</xsl:template>
 
89
 
 
90
<xsl:template match="cr:publisher">
 
91
 <publisher>
 
92
  <xsl:value-of select="cr:publisher_name"/>
 
93
 </publisher>
 
94
 <address>
 
95
  <xsl:value-of select="cr:publisher_place"/>
 
96
 </address>
 
97
</xsl:template>
 
98
 
 
99
<xsl:template match="cr:journal_metadata">
 
100
 <journal>
 
101
  <xsl:value-of select="cr:full_title"/>
 
102
 </journal>
 
103
 <xsl:apply-templates/>
 
104
</xsl:template>
 
105
 
 
106
<xsl:template match="cr:edition">
 
107
 <edition>
 
108
  <xsl:value-of select="."/>
 
109
 </edition>
 
110
</xsl:template>
 
111
 
 
112
<xsl:template match="cr:volume">
 
113
 <volume>
 
114
  <xsl:value-of select="."/>
 
115
 </volume>
 
116
</xsl:template>
 
117
 
 
118
<xsl:template match="cr:issue">
 
119
 <number>
 
120
  <xsl:value-of select="."/>
 
121
 </number>
 
122
</xsl:template>
 
123
 
 
124
<xsl:template match="cr:series_metadata">
 
125
 <series>
 
126
  <xsl:value-of select="cr:titles/cr:title[1]"/>
 
127
 </series>
 
128
</xsl:template>
 
129
 
 
130
<xsl:template match="cr:doi_data">
 
131
 <doi>
 
132
  <xsl:value-of select="cr:doi"/>
 
133
 </doi>
 
134
 <url>
 
135
  <xsl:value-of select="cr:resource"/>
 
136
 </url>
 
137
</xsl:template>
 
138
 
 
139
<xsl:template match="cr:publication_date">
 
140
 <year>
 
141
  <xsl:value-of select="cr:year"/>
 
142
 </year>
 
143
 <month>
 
144
  <xsl:value-of select="cr:month"/>
 
145
 </month>
 
146
</xsl:template>
 
147
 
 
148
<xsl:template match="cr:pages">
 
149
 <pages>
 
150
  <xsl:value-of select="concat(cr:first_page,'-',cr:last_page)"/>
 
151
 </pages>
 
152
</xsl:template>
 
153
 
 
154
<xsl:template match="cr:contributors">
 
155
 <authors>
 
156
  <xsl:for-each select="cr:person_name[@contributor_role='author']">
 
157
   <author>
 
158
    <xsl:value-of select="concat(cr:given_name,' ',cr:surname)"/>
 
159
   </author>
 
160
  </xsl:for-each>
 
161
 </authors>
 
162
 <editors>
 
163
  <xsl:for-each select="cr:person_name[@contributor_role='editor']">
 
164
   <editor>
 
165
    <xsl:value-of select="concat(cr:given_name,' ',cr:surname)"/>
 
166
   </editor>
 
167
  </xsl:for-each>
 
168
 </editors>
 
169
 <organization>
 
170
  <xsl:value-of select="cr:organization[1]"/>
 
171
 </organization>
 
172
</xsl:template>
 
173
 
 
174
</xsl:stylesheet>