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 <xsl:for-each select="author/name">
77 <pz:metadata type="author">
78 <xsl:value-of select="." />
82 <xsl:for-each select="article/title">
83 <pz:metadata type="title">
84 <xsl:value-of select="." />
88 <xsl:for-each select="journal/issn">
89 <pz:metadata type="issn">
90 <xsl:value-of select="." />
94 <xsl:for-each select="journal/title">
95 <pz:metadata type="journal-title">
96 <xsl:value-of select="." />
100 <xsl:for-each select="journal/vol">
101 <pz:metadata type="journal-number">
102 <xsl:value-of select="." />
106 <xsl:for-each select="journal/issue">
107 <pz:metadata type="issue-number">
108 <xsl:value-of select="." />
112 <xsl:for-each select="journal">
113 <pz:metadata type="journal-subpart">
114 <xsl:text>Vol. </xsl:text><xsl:value-of select="vol" /><xsl:text>,</xsl:text>
115 <xsl:if test="issue">
116 <xsl:text> no. </xsl:text><xsl:value-of select="issue" />
118 <xsl:text> (</xsl:text>
120 <xsl:when test="month='01'">
121 <xsl:text>Jan. </xsl:text>
123 <xsl:when test="month='02'">
124 <xsl:text>Feb. </xsl:text>
126 <xsl:when test="month='03'">
127 <xsl:text>Mar. </xsl:text>
129 <xsl:when test="month='04'">
130 <xsl:text>Apr. </xsl:text>
132 <xsl:when test="month='05'">
133 <xsl:text>May </xsl:text>
135 <xsl:when test="month='06'">
136 <xsl:text>June </xsl:text>
138 <xsl:when test="month='07'">
139 <xsl:text>July </xsl:text>
141 <xsl:when test="month='08'">
142 <xsl:text>Aug. </xsl:text>
144 <xsl:when test="month='09'">
145 <xsl:text>Sept. </xsl:text>
147 <xsl:when test="month='10'">
148 <xsl:text>Oct. </xsl:text>
150 <xsl:when test="month='11'">
151 <xsl:text>Nov. </xsl:text>
153 <xsl:when test="month='12'">
154 <xsl:text>Dec. </xsl:text>
157 <xsl:value-of select="month"/><xsl:text> </xsl:text>
160 <xsl:value-of select="year" /><xsl:text>)</xsl:text>
162 <xsl:text>, p. </xsl:text><xsl:value-of select="page" />
167 <pz:metadata type="description">
168 <xsl:value-of select="$description" />
171 <xsl:for-each select="ctrlT/term">
172 <pz:metadata type="subject">
173 <xsl:value-of select="." />
177 <xsl:for-each select="article/fulltext">
178 <pz:metadata type="fulltext">
179 <xsl:value-of select="." />
183 <pz:metadata type="medium">
184 <xsl:value-of select="$vmedium" />
186 <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
187 <xsl:text> (electronic)</xsl:text>
193 <!-- passthrough id data -->
194 <xsl:for-each select="pz:metadata">
195 <xsl:copy-of select="." />
198 <!-- other stylesheets importing this might want to define this -->
199 <xsl:call-template name="record-hook" />
205 <xsl:template match="text()" />