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:control">
50 <xsl:if test="@prim:recordid">
51 <pz:metadata type="id">
52 <xsl:value-of select="@prim:recordid"/>
55 <xsl:apply-templates />
58 <xsl:template match="prim:addata">
59 <!-- <xsl:variable name="yearmonthday" select="@date" /> -->
61 <xsl:if test="@prim:date">
62 <pz:metadata type="date">
63 <xsl:value-of select="substring(@date,1,4)" />
65 <pz:metadata type="journal-month">
66 <xsl:value-of select="substring(@date,4,1)" />
70 <xsl:if test="@prim:volume">
71 <pz:metadata type="journal-number">
72 <xsl:value-of select="@prim:volume" />
76 <xsl:if test="@prim:issue">
77 <pz:metadata type="issue-number">
78 <xsl:value-of select="@prim:issue" />
82 <xsl:if test="@prim:issn">
83 <pz:metadata type="issn">
84 <xsl:value-of select="@prim:issn" />
88 <xsl:if test="@prim:jtitle">
89 <pz:metadata type="journal-title">
90 <xsl:value-of select="@prim:jtitle" />
94 <xsl:apply-templates />
97 <xsl:template match="prim:delivery">
98 <xsl:if test="$has_fulltext">
99 <pz:metadata type="has-fulltext">
100 <xsl:value-of select="$has_fulltext" />
104 <xsl:apply-templates />
107 <xsl:template match="prim:display" name="display" >
108 <xsl:if test="@prim:creator">
109 <pz:metadata type="author">
110 <xsl:value-of select="@prim:creator" />
115 <xsl:if test="@prim:type">
116 <xsl:variable name="type" select="@prim:type"/>
117 <pz:metadata type="medium">
119 <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
120 <xsl:text>e-article</xsl:text>
122 <xsl:when test="$type = 'article' and $has_fulltext = 'no'">
123 <xsl:text>article</xsl:text>
126 <xsl:value-of select="$type"/>
129 <!-- <xsl:value-of select="$type" /> -->
131 <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
135 <xsl:if test="@prim:title">
136 <pz:metadata type="title">
137 <xsl:value-of select="@prim:title" />
141 <xsl:if test="@prim:ispartof">
142 <pz:metadata type="journal-subpart">
143 <xsl:value-of select="@prim:ispartof" />
146 <xsl:apply-templates />
149 <xsl:template match="sear:LINKS" >
150 <xsl:if test="@sear:openurl">
151 <pz:metadata type="electronic-url">
152 <xsl:value-of select="@sear:openurl"/>
155 <xsl:apply-templates/>
158 <xsl:template match="prim:search">
159 <xsl:if test="@prim:description">
160 <pz:metadata type="description">
161 <xsl:value-of select="@prim:description" />
166 <xsl:if test="@prim:sub">
167 <pz:metadata type="subject">
168 <xsl:value-of select="@prim:sub" />
172 <!-- passthrough id data -->
173 <xsl:for-each select="pz:metadata">
174 <xsl:copy-of select="." />
176 <!-- other stylesheets importing this might want to define this -->
178 <xsl:call-template name="record-hook" />
182 <xsl:template match="text()" />