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"
11 <xsl:output indent="yes" method="xml" version="1.0"
14 <xsl:variable name="type" select="/opt/prim:PrimoNMBib/prim:display/@prim:type"/>
15 <xsl:variable name="is_article" select="$type = 'article'" />
16 <xsl:variable name="fulltext" select="/opt/prim:PrimoNMBib/prim:delivery/@prim:fulltext"/>
17 <xsl:variable name="has_fulltext">
19 <xsl:when test="$fulltext = 'no_fulltext' ">
20 <xsl:text>no</xsl:text>
22 <xsl:when test="$fulltext = 'fulltext'">
23 <xsl:text>yes</xsl:text>
26 <xsl:text>no</xsl:text>
33 <xsl:template name="record-hook" />
35 <xsl:template match="/">
36 <xsl:apply-templates />
39 <xsl:template match="opt">
41 <xsl:apply-templates />
45 <xsl:template match="prim:PrimoNMBib">
46 <xsl:apply-templates />
49 <xsl:template match="prim:record[@name='control']">
50 <xsl:if test="@recordid">
51 <pz:metadata type="id">
52 <xsl:value-of select="@recordid"/>
55 <xsl:apply-templates />
58 <xsl:template match="prim:record[@name='addata']">
60 <pz:metadata type="date">
61 <xsl:value-of select="substring(@date,1,4)" />
63 <pz:metadata type="fulldate">
64 <xsl:value-of select="@date" />
66 <pz:metadata type="journal-month">
67 <xsl:value-of select="substring(@date,5,2)" />
71 <xsl:if test="@volume">
72 <pz:metadata type="journal-number">
73 <xsl:value-of select="@volume" />
77 <xsl:if test="@issue">
78 <pz:metadata type="issue-number">
79 <xsl:value-of select="@issue" />
84 <pz:metadata type="issn">
85 <xsl:value-of select="@issn" />
89 <xsl:if test="@jtitle">
90 <pz:metadata type="journal-title">
91 <xsl:value-of select="@jtitle" />
95 <xsl:apply-templates />
98 <xsl:template match="prim:record[@name='delivery']">
99 <xsl:if test="$has_fulltext">
100 <pz:metadata type="has-fulltext">
101 <xsl:value-of select="$has_fulltext" />
105 <xsl:apply-templates />
108 <xsl:template match="prim:record[@name='display']">
110 <xsl:if test="@creator">
111 <pz:metadata type="author">
112 <xsl:value-of select="@creator" />
116 <xsl:if test="@type">
117 <xsl:variable name="type" select="@type"/>
118 <pz:metadata type="medium">
120 <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
121 <xsl:text>e-article</xsl:text>
123 <xsl:when test="$type = 'article' and $has_fulltext = 'no'">
124 <xsl:text>article</xsl:text>
127 <xsl:value-of select="$type"/>
130 <!-- <xsl:value-of select="$type" /> -->
132 <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
135 <xsl:if test="@title">
136 <pz:metadata type="title">
137 <xsl:value-of select="@title" />
141 <xsl:if test="@ispartof">
142 <pz:metadata type="journal-subpart">
143 <xsl:value-of select="@ispartof" />
146 <xsl:apply-templates />
150 <xsl:template match="prim:record[@name='search']">
151 <xsl:if test="@description">
152 <pz:metadata type="description">
153 <xsl:value-of select="@description" />
158 <pz:metadata type="subject">
159 <xsl:value-of select="@sub" />
163 <!-- passthrough id data -->
164 <xsl:for-each select="pz:metadata">
165 <xsl:copy-of select="." />
167 <!-- other stylesheets importing this might want to define this -->
169 <xsl:call-template name="record-hook" />
173 <xsl:template match="sear:LINKS" >
174 <xsl:if test="@sear:openurl">
175 <pz:metadata type="electronic-url">
176 <xsl:value-of select="@sear:openurl"/>
179 <xsl:apply-templates/>
183 <xsl:template match="text()" />