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="journal-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:issn">
85 <pz:metadata type="issn">
86 <xsl:value-of select="." />
90 <xsl:for-each select="prim:jtitle">
91 <pz:metadata type="journal-title">
92 <xsl:value-of select="." />
97 <xsl:template match="prim:delivery">
99 <xsl:if test="$has_fulltext">
100 <pz:metadata type="has-fulltext">
101 <xsl:value-of select="$has_fulltext" />
107 <xsl:template match="prim:display">
108 <xsl:for-each select="prim:creator">
109 <pz:metadata type="author">
110 <xsl:value-of select="." />
113 <xsl:for-each select="prim:type">
114 <xsl:variable name="type" select="."/>
115 <pz:metadata type="medium">
117 <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
118 <xsl:text>e-article</xsl:text>
120 <xsl:when test="$type = 'article' and $has_fulltext = 'no'">
121 <xsl:text>article</xsl:text>
124 <xsl:value-of select="$type"/>
127 <!-- <xsl:value-of select="$type" /> -->
129 <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
132 <xsl:for-each select="prim:title">
133 <pz:metadata type="title">
134 <xsl:value-of select="." />
138 <xsl:for-each select="prim:ispartof">
139 <pz:metadata type="journal-subpart">
140 <xsl:value-of select="." />
144 <xsl:apply-templates />
148 <xsl:template match="prim:facets">
149 <xsl:for-each select="prim:topic">
150 <pz:metadata type="subject">
151 <xsl:value-of select="." />
156 <xsl:template match="sear:LINKS" >
157 <xsl:for-each select="sear:openurl">
158 <pz:metadata type="electronic-url">
159 <xsl:value-of select="."/>
164 <xsl:template match="prim:search">
165 <xsl:for-each select="prim:description">
166 <pz:metadata type="description">
167 <xsl:value-of select="." />
172 <xsl:for-each select="prim:sub">
173 <pz:metadata type="subject">
174 <xsl:value-of select="." />
178 <!-- passthrough id data -->
179 <xsl:for-each select="pz:metadata">
180 <xsl:copy-of select="." />
182 <!-- other stylesheets importing this might want to define this -->
184 <xsl:call-template name="record-hook" />
187 <xsl:template match="text()" />