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"
9 <xsl:output indent="yes" method="xml" version="1.0"
11 <xsl:template name="record-hook" />
12 <xsl:variable name="type" select="/opt/prim:PrimoNMBib/prim:display/prim:type"/>
13 <xsl:variable name="is_article" select="$type = 'article'" />
14 <xsl:variable name="fulltext" select="/opt/prim:PrimoNMBib/prim:delivery/prim:fulltext"/>
15 <xsl:variable name="has_fulltext">
17 <xsl:when test="$fulltext = 'no_fulltext' ">
18 <xsl:text>no</xsl:text>
20 <xsl:when test="$fulltext = 'fulltext'">
21 <xsl:text>yes</xsl:text>
24 <xsl:text>no</xsl:text>
29 <xsl:template match="/">
30 <xsl:apply-templates />
33 <xsl:template match="sear:RESULT">
35 <xsl:apply-templates />
39 <xsl:template match="sear:DOC">
41 <xsl:apply-templates />
45 <xsl:template match="prim:PrimoNMBib">
46 <xsl:apply-templates />
49 <xsl:template match="prim:control">
50 <xsl:for-each select="prim:recordid">
51 <pz:metadata type="id">
52 <xsl:value-of select="."/>
57 <xsl:template match="prim:addata">
58 <!-- <xsl:variable name="yearmonthday" select="@date" /> -->
60 <xsl:for-each select="prim:date">
61 <pz:metadata type="date">
62 <xsl:value-of select="substring(.,1,4)" />
64 <pz:metadata type="journal-month">
65 <xsl:value-of select="substring(.,4,1)" />
69 <xsl:for-each select="prim:volume">
70 <pz:metadata type="volume-number">
71 <xsl:value-of select="." />
75 <xsl:for-each select="prim:issue">
76 <pz:metadata type="issue-number">
77 <xsl:value-of select="." />
81 <xsl:for-each select="prim:spage">
82 <pz:metadata type="pages-number">
83 <xsl:value-of select="." />
87 <xsl:for-each select="prim:issn">
88 <pz:metadata type="issn">
89 <xsl:value-of select="." />
93 <xsl:for-each select="prim:jtitle">
94 <pz:metadata type="journal-title">
95 <xsl:value-of select="." />
100 <xsl:template match="prim:delivery">
101 <xsl:if test="$has_fulltext">
102 <pz:metadata type="has-fulltext">
103 <xsl:value-of select="$has_fulltext" />
108 <xsl:template match="prim:display">
109 <xsl:for-each select="prim:type">
110 <xsl:variable name="type" select="."/>
111 <pz:metadata type="medium">
113 <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
114 <xsl:text>e-article</xsl:text>
116 <xsl:when test="$type = 'article' and $has_fulltext = 'no'">
117 <xsl:text>article</xsl:text>
120 <xsl:value-of select="$type"/>
124 <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
127 <xsl:for-each select="prim:title">
128 <pz:metadata type="title">
129 <xsl:value-of select="." />
133 <xsl:for-each select="prim:ispartof">
134 <pz:metadata type="citation">
135 <xsl:value-of select="." />
140 <xsl:template match="prim:facets">
141 <xsl:for-each select="prim:topic">
142 <pz:metadata type="subject">
143 <xsl:value-of select="." />
148 <xsl:template match="sear:LINKS" >
149 <xsl:for-each select="sear:openurl">
150 <pz:metadata type="electronic-url">
151 <xsl:value-of select="."/>
156 <xsl:template match="prim:search">
158 <xsl:for-each select="prim:creatorcontrib">
159 <pz:metadata type="author">
160 <xsl:value-of select="." />
164 <xsl:for-each select="prim:description">
165 <pz:metadata type="description">
166 <xsl:value-of select="." />
171 <xsl:for-each select="prim:sub">
172 <pz:metadata type="subject">
173 <xsl:value-of select="." />
177 <!-- passthrough id data -->
178 <xsl:for-each select="pz:metadata">
179 <xsl:copy-of select="." />
181 <!-- other stylesheets importing this might want to define this -->
183 <xsl:call-template name="record-hook" />
186 <xsl:template match="text()" />