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:tmarc="http://www.indexdata.com/turbomarc"
6 xmlns:prim="http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib"
7 xmlns:sear="http://www.exlibrisgroup.com/xsd/jaguar/search"
10 <xsl:output indent="yes" method="xml" version="1.0"
13 <xsl:template name="record-hook" />
15 <xsl:variable name="type" select="/opt/prim:PrimoNMBib/prim:display/prim:type"/>
16 <xsl:variable name="is_article" select="$type = 'article'" />
17 <xsl:variable name="fulltext" select="/opt/prim:PrimoNMBib/prim:delivery/prim:fulltext"/>
18 <xsl:variable name="has_fulltext">
20 <xsl:when test="$fulltext = 'no_fulltext' ">
21 <xsl:text>no</xsl:text>
23 <xsl:when test="$fulltext = 'fulltext'">
24 <xsl:text>yes</xsl:text>
27 <xsl:text>no</xsl:text>
32 <xsl:template match="/">
33 <xsl:apply-templates />
36 <xsl:template match="sear:RESULT">
38 <xsl:apply-templates />
42 <xsl:template match="sear:DOC">
44 <xsl:apply-templates />
48 <xsl:template match="prim:PrimoNMBib">
49 <xsl:apply-templates />
52 <xsl:template match="prim:control">
53 <xsl:for-each select="prim:recordid">
54 <pz:metadata type="id">
55 <xsl:value-of select="."/>
60 <xsl:template match="prim:addata">
61 <!-- <xsl:variable name="yearmonthday" select="@date" /> -->
63 <xsl:for-each select="prim:date">
64 <pz:metadata type="date">
65 <xsl:value-of select="substring(.,1,4)" />
67 <pz:metadata type="journal-month">
68 <xsl:value-of select="substring(.,4,1)" />
72 <xsl:for-each select="prim:volume">
73 <pz:metadata type="volume-number">
74 <xsl:value-of select="." />
78 <xsl:for-each select="prim:issue">
79 <pz:metadata type="issue-number">
80 <xsl:value-of select="." />
84 <xsl:for-each select="prim:spage">
85 <pz:metadata type="pages-number">
86 <xsl:value-of select="." />
90 <xsl:for-each select="prim:issn">
91 <pz:metadata type="issn">
92 <xsl:value-of select="." />
96 <xsl:for-each select="prim:jtitle">
97 <pz:metadata type="citation">
98 <xsl:value-of select="." />
103 <xsl:template match="prim:delivery">
105 <xsl:if test="$has_fulltext">
106 <pz:metadata type="has-fulltext">
107 <xsl:value-of select="$has_fulltext" />
113 <xsl:template match="prim:display">
116 <xsl:for-each select="prim:creator">
117 <pz:metadata type="author">
118 <xsl:value-of select="." />
122 <xsl:for-each select="prim:type">
123 <xsl:variable name="type" select="."/>
124 <pz:metadata type="medium">
126 <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
127 <xsl:text>e-article</xsl:text>
129 <xsl:when test="$type = 'article' and $has_fulltext = 'no'">
130 <xsl:text>article</xsl:text>
133 <xsl:value-of select="$type"/>
136 <!-- <xsl:value-of select="$type" /> -->
138 <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
141 <xsl:for-each select="prim:title">
142 <pz:metadata type="title">
143 <xsl:value-of select="." />
147 <xsl:for-each select="prim:ispartof">
148 <pz:metadata type="journal-subpart">
149 <xsl:value-of select="." />
153 <xsl:apply-templates />
157 <xsl:template match="prim:facets">
158 <xsl:for-each select="prim:topic">
159 <pz:metadata type="subject">
160 <xsl:value-of select="." />
165 <xsl:template match="sear:LINKS" >
166 <xsl:for-each select="sear:openurl">
167 <pz:metadata type="electronic-url">
168 <xsl:value-of select="."/>
173 <xsl:template match="prim:search">
175 <xsl:for-each select="prim:creatorcontrib">
176 <pz:metadata type="author">
177 <xsl:value-of select="." />
181 <xsl:for-each select="prim:description">
182 <pz:metadata type="description">
183 <xsl:value-of select="." />
188 <xsl:for-each select="prim:sub">
189 <pz:metadata type="subject">
190 <xsl:value-of select="." />
194 <!-- passthrough id data -->
195 <xsl:for-each select="pz:metadata">
196 <xsl:copy-of select="." />
198 <!-- other stylesheets importing this might want to define this -->
200 <xsl:call-template name="record-hook" />
203 <xsl:template match="text()" />