1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
5 xmlns:zs="http://www.loc.gov/zing/srw/"
6 xmlns:tmarc="http://www.indexdata.com/turbomarc">
8 <xsl:output indent="yes" method="xml" version="1.0"
10 <xsl:param name="medium"/>
12 <!-- Extract metadata from MARC21/USMARC from streamlined marcxml format
13 http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
14 <xsl:template name="record-hook" />
17 <xsl:template match="/">
18 <xsl:apply-templates />
21 <xsl:template match="zs:searchRetrieveResponse">
22 <xsl:apply-templates />
25 <xsl:template match="zs:records">
27 <xsl:apply-templates />
31 <xsl:template match="zs:record">
32 <xsl:apply-templates />
35 <xsl:template match="zs:recordData">
36 <xsl:apply-templates />
39 <xsl:template match="doc">
41 <xsl:apply-templates />
45 <xsl:template match="art">
46 <xsl:variable name="journal_title" select="journal/title" />
47 <xsl:variable name="journal_issn" select="journal/issn" />
48 <xsl:variable name="date" select="journal/year" />
49 <xsl:variable name="description" select="abstract/abstract" />
51 <xsl:variable name="has_fulltext" select="article/fulltext"/>
52 <xsl:variable name="has_title" select="article/title"/>
54 <xsl:variable name="vmedium">
56 <xsl:when test="$has_title and $has_fulltext">
57 <xsl:text>e-article</xsl:text>
59 <xsl:when test="$has_title and not($has_fulltext)">
60 <xsl:text>article</xsl:text>
63 <xsl:text>other</xsl:text>
70 <xsl:for-each select="localInfo/systemno">
71 <pz:metadata type="id">
72 <xsl:value-of select="."/>
76 <!-- IDs for url recipe -->
77 <xsl:for-each select="recordID/DOI">
78 <pz:metadata type="doi"><xsl:value-of select="."/></pz:metadata>
80 <xsl:for-each select="recordID/artId">
81 <pz:metadata type="artid"><xsl:value-of select="."/></pz:metadata>
83 <xsl:for-each select="recordID/accessNr">
84 <pz:metadata type="accessnr"><xsl:value-of select="."/></pz:metadata>
87 <xsl:for-each select="author/name">
88 <pz:metadata type="author">
89 <xsl:value-of select="." />
93 <xsl:for-each select="article/title">
94 <pz:metadata type="title">
95 <xsl:value-of select="." />
99 <xsl:for-each select="journal/issn">
100 <pz:metadata type="issn">
101 <xsl:value-of select="." />
105 <xsl:for-each select="journal/title">
106 <pz:metadata type="journal-title">
107 <xsl:value-of select="." />
111 <xsl:for-each select="journal/vol">
112 <pz:metadata type="journal-number">
113 <xsl:value-of select="." />
117 <xsl:for-each select="journal/issue">
118 <pz:metadata type="issue-number">
119 <xsl:value-of select="." />
123 <xsl:for-each select="journal">
124 <pz:metadata type="journal-subpart">
125 <xsl:text>Vol. </xsl:text><xsl:value-of select="vol" /><xsl:text>,</xsl:text>
126 <xsl:if test="issue">
127 <xsl:text> no. </xsl:text><xsl:value-of select="issue" />
129 <xsl:text> (</xsl:text>
131 <xsl:when test="month='01'">
132 <xsl:text>Jan. </xsl:text>
134 <xsl:when test="month='02'">
135 <xsl:text>Feb. </xsl:text>
137 <xsl:when test="month='03'">
138 <xsl:text>Mar. </xsl:text>
140 <xsl:when test="month='04'">
141 <xsl:text>Apr. </xsl:text>
143 <xsl:when test="month='05'">
144 <xsl:text>May </xsl:text>
146 <xsl:when test="month='06'">
147 <xsl:text>June </xsl:text>
149 <xsl:when test="month='07'">
150 <xsl:text>July </xsl:text>
152 <xsl:when test="month='08'">
153 <xsl:text>Aug. </xsl:text>
155 <xsl:when test="month='09'">
156 <xsl:text>Sept. </xsl:text>
158 <xsl:when test="month='10'">
159 <xsl:text>Oct. </xsl:text>
161 <xsl:when test="month='11'">
162 <xsl:text>Nov. </xsl:text>
164 <xsl:when test="month='12'">
165 <xsl:text>Dec. </xsl:text>
168 <xsl:value-of select="month"/><xsl:text> </xsl:text>
171 <xsl:value-of select="year" /><xsl:text>)</xsl:text>
173 <xsl:text>, p. </xsl:text><xsl:value-of select="page" />
178 <pz:metadata type="description">
179 <xsl:value-of select="$description" />
182 <xsl:for-each select="ctrlT/term">
183 <pz:metadata type="subject">
184 <xsl:value-of select="." />
188 <xsl:for-each select="article/fulltext">
189 <pz:metadata type="fulltext">
190 <xsl:value-of select="." />
194 <pz:metadata type="medium">
195 <xsl:value-of select="$vmedium" />
197 <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
198 <xsl:text> (electronic)</xsl:text>
204 <!-- passthrough id data -->
205 <xsl:for-each select="pz:metadata">
206 <xsl:copy-of select="." />
209 <!-- other stylesheets importing this might want to define this -->
210 <xsl:call-template name="record-hook" />
216 <xsl:template match="text()" />