XSL files in separate directory; remove some un-maintained XSLs
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 24 Apr 2014 11:00:34 +0000 (13:00 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 24 Apr 2014 11:01:48 +0000 (13:01 +0200)
44 files changed:
Makefile.am
debian/rules
etc/MarcXML2TurboMarc.xsl [deleted file]
etc/cf.xsl [deleted file]
etc/dads-pz2.xsl [deleted file]
etc/danmarc2.xsl [deleted file]
etc/dc.xsl [deleted file]
etc/dkabm.xsl [deleted file]
etc/marc21-ourl.xsl [deleted file]
etc/marc21.xsl [deleted file]
etc/marc22.xsl [deleted file]
etc/oai_dc.xsl [deleted file]
etc/opac.xsl [deleted file]
etc/opac_turbomarc.xsl [deleted file]
etc/pazpar2.cfg.dist
etc/perf_server.cfg
etc/pp2out-to-carrot2.xsl [deleted file]
etc/primo-pz2.xsl [deleted file]
etc/pz2-ourl-base.xsl [deleted file]
etc/pz2-ourl-marc21.xsl [deleted file]
etc/pz2-solr.xsl [deleted file]
etc/server.xml
etc/solr-pz2.xsl [deleted file]
etc/tmarc.xsl [deleted file]
etc/unimarc.xsl [deleted file]
etc/usmarc.xsl [deleted file]
etc/xsl/MarcXML2TurboMarc.xsl [new file with mode: 0644]
etc/xsl/cf.xsl [new file with mode: 0644]
etc/xsl/danmarc2.xsl [new file with mode: 0644]
etc/xsl/dc.xsl [new file with mode: 0644]
etc/xsl/dkabm.xsl [new file with mode: 0644]
etc/xsl/marc21-ourl.xsl [new file with mode: 0644]
etc/xsl/marc21.xsl [new file with mode: 0644]
etc/xsl/oai_dc.xsl [new file with mode: 0644]
etc/xsl/opac.xsl [new file with mode: 0644]
etc/xsl/opac_turbomarc.xsl [new file with mode: 0644]
etc/xsl/pp2out-to-carrot2.xsl [new file with mode: 0644]
etc/xsl/primo-pz2.xsl [new file with mode: 0644]
etc/xsl/pz2-ourl-base.xsl [new file with mode: 0644]
etc/xsl/pz2-ourl-marc21.xsl [new file with mode: 0644]
etc/xsl/solr-pz2.xsl [new file with mode: 0644]
etc/xsl/tmarc.xsl [new file with mode: 0644]
etc/xsl/unimarc.xsl [new file with mode: 0644]
pazpar2.spec

index 02c2225..e894cf2 100644 (file)
@@ -10,7 +10,7 @@ EXTRA_DIST = $(PACKAGE).spec IDMETA README NEWS LICENSE m4/id-config.sh \
 
 dist-hook:
        if test -x /usr/bin/git -a -d .git; then git log >ChangeLog ; cp ChangeLog $(distdir); fi
-       for d in etc etc/settings etc/services www/test1 www/jsdemo; do \
+       for d in etc etc/xsl etc/settings etc/services www/test1 www/jsdemo; do \
                mkdir -p $(distdir)/$$d; cp -r $$d/* $(distdir)/$$d; \
        done; rm -f $(distdir)/etc/pazpar2.cfg; exit 0
        mkdir $(distdir)/rpm
index e460465..1baae7e 100755 (executable)
@@ -24,7 +24,7 @@ override_dh_auto_install:
        cp etc/services/*.xml debian/pazpar2/etc/pazpar2/services-available
        cp etc/settings/*.xml debian/pazpar2/etc/pazpar2/settings/
        cp -r etc/settings/mkc debian/pazpar2/etc/pazpar2/settings
-       cp etc/*.xsl debian/pazpar2/etc/pazpar2/
+       cp -r etc/xsl debian/pazpar2/etc/pazpar2
 # pazpar2-apache2 package
        cp debian/ap2pazpar2.cfg debian/pazpar2-apache2/etc/pazpar2
 # pazpar2-test1 package
diff --git a/etc/MarcXML2TurboMarc.xsl b/etc/MarcXML2TurboMarc.xsl
deleted file mode 100644 (file)
index 566fe03..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Converts MarcXML to TurboMarc
-    (to benefit from pazpar2's improved tmarc.xsl)
-
-    Also includes a provision to handle PicaMarc where datafield names can
-    contain a @ that is changed to Ä to give valid XML.
-    2010-2011
-    Sven-S. Porst, SUB Göttingen <porst@sub.uni-goettingen.de>
--->
-<xsl:stylesheet
-   version="1.0"
-   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-   xmlns:tmarc="http://www.indexdata.com/turbomarc"
-   xmlns:marc="http://www.loc.gov/MARC21/slim">
-
-<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<xsl:template match="@*|node()">
-  <xsl:copy>
-    <xsl:apply-templates select="@*|node()"/>
-    </xsl:copy>
-</xsl:template>
-
-
-<xsl:template match="record|marc:record">
-  <xsl:element name="r" namespace="http://www.indexdata.com/turbomarc">
-    <xsl:apply-templates select="@*|node()"/>
-    </xsl:element>
-</xsl:template>
-
-
-<xsl:template match="leader|marc:leader">
-  <xsl:element name="l" namespace="http://www.indexdata.com/turbomarc">
-    <xsl:apply-templates select="@*|node()"/>
-    </xsl:element>
-</xsl:template>
-
-
-<xsl:template match="controlfield|datafield|subfield|marc:controlfield|marc:datafield|marc:subfield">
-  <!--
-      Try to mock Indexdata's specification without regexps:
-      Translate all allowed characters to 'a' and assume field names are
-      shorter than 62 characters.
-      Given the typical 3 digit Marc field numbers this seems
-      safe in the practical cases I have seen.
-
-      http://www.indexdata.com/blog/2010/05/turbomarc-faster-xml-marc-records
-      http://www.indexdata.com/yaz/doc/marc.html
-      -->
-
-  <xsl:variable name="allowedCharacters" select="'0123465789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@'"/>
-  <xsl:variable name="manyAs" select="'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'"/>
-
-  <xsl:choose>
-    <xsl:when test="(name(.)='datafield' or name(.)='controlfield') and
-                   contains($manyAs, translate(@tag, $allowedCharacters, $manyAs))">
-      <xsl:element name="{concat(substring(local-name(),1,1), translate(@tag,'@','Ä'))}"
-                  namespace="http://www.indexdata.com/turbomarc">
-       <xsl:apply-templates select="@*[name(.)!='tag']|node()"/>
-       </xsl:element>
-      </xsl:when>
-
-    <xsl:when test="name(.)='subfield' and
-                   contains($manyAs, translate(@code, $allowedCharacters, $manyAs))">
-      <xsl:element name="{concat(substring(local-name(),1,1), @code)}"
-                  namespace="http://www.indexdata.com/turbomarc">
-       <xsl:apply-templates select="@*[name(.)!='code']|node()"/>
-       </xsl:element>
-      </xsl:when>
-
-    <xsl:otherwise>
-      <xsl:copy>
-       <xsl:apply-templates select="@*|node()"/>
-       </xsl:copy>
-      </xsl:otherwise>
-    </xsl:choose>
-</xsl:template>
-
-
-</xsl:stylesheet>
diff --git a/etc/cf.xsl b/etc/cf.xsl
deleted file mode 100644 (file)
index 7796273..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    This stylesheet expects Connector Frameworks records
--->
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:siebel="http://loc.gov/siebel/elements/1.0/" >
-
- <xsl:output indent="yes"
-        method="xml"
-        version="1.0"
-        encoding="UTF-8"/>
-
-  <xsl:param name="medium" />
-
-  <!--
-    According to cf/builder/templates/parseTask.cff, connectors can
-    also generate a "medium" field, but that is ignored in this
-    stylesheet, the rule below instead using an XSLT parameter.
-    Should the data element be used in preference when it is included?
-  -->
-
-  <xsl:template match="/record">
-    <pz:record>
-      <pz:metadata type="medium">
-        <xsl:choose>
-          <xsl:when test="string-length($medium)">
-            <xsl:value-of select="$medium" />
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:if test="medium">
-             <xsl:value-of select="medium" />
-            </xsl:if>
-          </xsl:otherwise>
-        </xsl:choose>
-      </pz:metadata>
-      <xsl:apply-templates/>
-    </pz:record>
-  </xsl:template>
-
-  <!--
-      The elements mapped in the following clauses should be kept more
-      or less in sync with those named in builder/templates/search.cft
-      in the "cf" git module.
-  -->
-
-  <xsl:template match="date">
-    <pz:metadata type="publication-date">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-    <pz:metadata type="date">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="url">
-    <pz:metadata type="electronic-url">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="title">
-    <pz:metadata type="title">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-    <pz:metadata type="title-complete">
-      <xsl:value-of select="." />
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="journaltitle">
-    <pz:metadata type="journal-title">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <!--
-    According to cf/builder/templates/parseTask.cff, connectors can
-    also generate a "holding" field, but it's not clear how that is
-    different from "item".  Perhaps this "item" rule should also
-    handle "holding" in the same way?
-  -->
-
-  <xsl:template match="item">
-    <pz:metadata type="due" empty="PAZPAR2_NULL_VALUE">
-      <xsl:value-of select="due"/>
-    </pz:metadata>
-    <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
-      <xsl:value-of select="location"/>
-    </pz:metadata>
-    <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
-      <xsl:value-of select="callno"/>
-    </pz:metadata>
-    <pz:metadata type="available" empty="PAZPAR_NULL_VALUE">
-      <xsl:value-of select="available"/>
-    </pz:metadata>
-    <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
-      <xsl:value-of select="publicnote"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="location">
-    <pz:metadata type="locallocation">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="callno">
-    <pz:metadata type="callnumber">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-  
-  <!-- no-op template to avoid printing medium out --> 
-  <xsl:template match="medium" />
-
-  <xsl:template match="*" >
-    <pz:metadata type="{local-name()}">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/dads-pz2.xsl b/etc/dads-pz2.xsl
deleted file mode 100644 (file)
index 09286ea..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-  xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-  xmlns:zs="http://www.loc.gov/zing/srw/"
-  xmlns:tmarc="http://www.indexdata.com/turbomarc">
-
-  <xsl:output indent="yes" method="xml" version="1.0"
-    encoding="UTF-8" />
-  <xsl:param name="medium"/>
-
-  <!-- Extract metadata from MARC21/USMARC from streamlined marcxml format 
-    http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
-  <xsl:template name="record-hook" />
-
-
-  <xsl:template match="/">
-      <xsl:apply-templates />
-  </xsl:template>
-
-  <xsl:template match="zs:searchRetrieveResponse">
-      <xsl:apply-templates />
-  </xsl:template>
-
-  <xsl:template match="zs:records">
-    <collection>
-      <xsl:apply-templates />
-    </collection>
-  </xsl:template>
-
-  <xsl:template match="zs:record">
-      <xsl:apply-templates />
-  </xsl:template>  
-
-  <xsl:template match="zs:recordData">
-      <xsl:apply-templates />
-  </xsl:template>
-
-  <xsl:template match="doc">
-    <collection>
-      <xsl:apply-templates />
-    </collection>
-  </xsl:template>
-
-  <xsl:template match="art">
-    <xsl:variable name="journal_title" select="journal/title" />
-    <xsl:variable name="journal_issn" select="journal/issn" />
-    <xsl:variable name="date" select="journal/year" />
-    <xsl:variable name="month" select="journal/month" />
-    <xsl:variable name="description" select="abstract/abstract" />
-
-    <xsl:variable name="has_fulltext" select="article/fulltext"/>
-    <xsl:variable name="has_title" select="article/title"/>
-
-    <xsl:variable name="vmedium">
-      <xsl:choose>
-        <xsl:when  test="$has_title and $has_fulltext">
-         <xsl:text>e-article</xsl:text>
-       </xsl:when>
-        <xsl:when  test="$has_title and not($has_fulltext)">
-         <xsl:text>article</xsl:text>
-       </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>other</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-    
-    <pz:record>
-
-      <xsl:for-each select="localInfo/systemno"> 
-        <pz:metadata type="id">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <!-- IDs for url recipe -->
-      <xsl:for-each select="recordID/DOI"> 
-       <pz:metadata type="doi"><xsl:value-of select="."/></pz:metadata>
-      </xsl:for-each>
-      <xsl:for-each select="recordID/artId"> 
-       <pz:metadata type="artid"><xsl:value-of select="."/></pz:metadata>
-      </xsl:for-each>
-      <xsl:for-each select="recordID/accessNr"> 
-       <pz:metadata type="accessnr"><xsl:value-of select="."/></pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="author/name">
-        <pz:metadata type="author">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-      
-      <xsl:for-each select="article/title">
-        <pz:metadata type="title">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="journal/issn">
-        <pz:metadata type="issn">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="journal/title">
-        <pz:metadata type="journal-title">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="journal/vol">
-        <pz:metadata type="journal-number">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="journal/issue">
-        <pz:metadata type="issue-number">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="journal"> 
-        <pz:metadata type="journal-subpart">
-         <xsl:if test="vol">
-           <xsl:text>Vol. </xsl:text><xsl:value-of select="vol" /><xsl:text>,</xsl:text>
-         </xsl:if>
-          <xsl:if test="issue">
-           <xsl:if test="vol">
-             <xsl:text> no. </xsl:text>
-           </xsl:if>
-           <xsl:if test="not(vol)">
-             <xsl:text>No. </xsl:text>
-           </xsl:if>
-           <xsl:value-of select="issue" />
-         </xsl:if>
-         <xsl:text> (</xsl:text>
-         <xsl:if test="month">
-           <xsl:choose>
-             <xsl:when test="$month='01'">
-               <xsl:text>Jan. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='02'">
-               <xsl:text>Feb. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='03'">
-               <xsl:text>Mar. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='04'">
-               <xsl:text>Apr. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='05'">
-               <xsl:text>May </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='06'">
-               <xsl:text>June </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='07'">
-               <xsl:text>July </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='08'">
-               <xsl:text>Aug. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='09'">
-               <xsl:text>Sept. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='10'">
-               <xsl:text>Oct. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='11'">
-               <xsl:text>Nov. </xsl:text>
-             </xsl:when>
-             <xsl:when test="$month='12'">
-               <xsl:text>Dec. </xsl:text>
-             </xsl:when>
-             <xsl:otherwise>
-               <xsl:value-of select="$month"/><xsl:text> </xsl:text>
-             </xsl:otherwise>
-           </xsl:choose>
-         </xsl:if>
-         <xsl:value-of select="year" /><xsl:text>)</xsl:text>
-         <xsl:if test="page"> 
-            <xsl:text>, p. </xsl:text><xsl:value-of select="page" />
-         </xsl:if>
-        </pz:metadata>
-      </xsl:for-each>      
-
-      <pz:metadata type="description">
-       <xsl:value-of select="$description" />
-      </pz:metadata>
-      
-      <xsl:for-each select="ctrlT/term">
-       <pz:metadata type="subject">
-          <xsl:value-of select="." />
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="article/fulltext">
-       <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-       </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-        <xsl:value-of select="$vmedium" />
-<!--
-        <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
-          <xsl:text> (electronic)</xsl:text>
-        </xsl:if>
--->
-      </pz:metadata>
-
-      <xsl:for-each select="recordID/DOI"> 
-       <pz:metadata type="url-doi"><xsl:text>http://dx.doi.org/</xsl:text><xsl:value-of select="."/></pz:metadata>
-      </xsl:for-each>
-
-      <!-- passthrough id data -->
-      <xsl:for-each select="pz:metadata">
-        <xsl:copy-of select="." />
-      </xsl:for-each>
-
-      <!-- other stylesheets importing this might want to define this -->
-      <xsl:call-template name="record-hook" />
-       
-    </pz:record>
-
-  </xsl:template>
-
-  <xsl:template match="text()" />
-
-</xsl:stylesheet>
diff --git a/etc/danmarc2.xsl b/etc/danmarc2.xsl
deleted file mode 100644 (file)
index 7e595b1..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-
-
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<!-- Beginnings of Danmarc2 XSL.
-
-   This is just USMARC with minor tweaks.. Not complete!
--->
-  <xsl:include href="pz2-ourl-marc21.xsl" />
-
-  <xsl:template match="/marc:record">
-    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
-    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
-    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
-    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
-    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
-    <xsl:variable name="medium">
-      <xsl:choose>
-       <xsl:when test="$title_medium">
-         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
-       </xsl:when>
-       <xsl:when test="$fulltext_a">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$fulltext_b">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$electronic_location_url">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$journal_title">
-         <xsl:text>article</xsl:text>
-       </xsl:when>
-       <xsl:otherwise>
-         <xsl:text>book</xsl:text>
-       </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <pz:record>
-      <xsl:attribute name="mergekey">
-        <xsl:text>title </xsl:text>
-       <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
-       <xsl:text> author </xsl:text>
-       <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
-       <xsl:text> medium </xsl:text>
-       <xsl:value-of select="$medium"/>
-      </xsl:attribute>
-
-
-      <xsl:for-each select="marc:datafield[@tag='001']/marc:subfield[@code='a']">
-        <pz:metadata type="id">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='010']">
-        <pz:metadata type="lccn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='020']">
-        <pz:metadata type="isbn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='022']">
-        <pz:metadata type="issn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='027']">
-        <pz:metadata type="tech-rep-nr">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='100']">
-       <pz:metadata type="author">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="author-title">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="author-date">
-         <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='110']">
-       <pz:metadata type="corporate-name">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="corporate-location">
-           <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="corporate-date">
-           <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='111']">
-       <pz:metadata type="meeting-name">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="meeting-location">
-           <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="meeting-date">
-           <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='260']">
-       <pz:metadata type="date">
-           <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='245']">
-        <pz:metadata type="title">
-          <xsl:value-of select="marc:subfield[@code='a']"/>
-        </pz:metadata>
-        <pz:metadata type="title-remainder">
-          <xsl:value-of select="marc:subfield[@code='b']"/>
-        </pz:metadata>
-        <pz:metadata type="title-responsibility">
-          <xsl:value-of select="marc:subfield[@code='c']"/>
-        </pz:metadata>
-        <pz:metadata type="title-dates">
-          <xsl:value-of select="marc:subfield[@code='f']"/>
-        </pz:metadata>
-        <pz:metadata type="title-medium">
-          <xsl:value-of select="marc:subfield[@code='h']"/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='250']">
-       <pz:metadata type="edition">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='260']">
-        <pz:metadata type="publication-place">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-        <pz:metadata type="publication-name">
-         <xsl:value-of select="marc:subfield[@code='b']"/>
-       </pz:metadata>
-        <pz:metadata type="publication-date">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='300']">
-       <pz:metadata type="physical-extent">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-format">
-         <xsl:value-of select="marc:subfield[@code='b']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-dimensions">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-accomp">
-         <xsl:value-of select="marc:subfield[@code='e']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-unittype">
-         <xsl:value-of select="marc:subfield[@code='f']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-unitsize">
-         <xsl:value-of select="marc:subfield[@code='g']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-specified">
-         <xsl:value-of select="marc:subfield[@code='3']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='440']">
-       <pz:metadata type="series-title">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
-                           [@tag != '506' and @tag != '530' and
-                           @tag != '540' and @tag != '546'
-                            and @tag != '522']">
-       <pz:metadata type="description">
-            <xsl:value-of select="*/text()"/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='650' or @tag='653'
-          or @tag='630' or @tag='666']">
-
-         <xsl:for-each select="marc:subfield">
-               <pz:metadata type="subject">
-                       <xsl:value-of select="."/>
-               </pz:metadata>
-         </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='856']">
-       <pz:metadata type="electronic-url">
-         <xsl:value-of select="marc:subfield[@code='u']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-text">
-         <xsl:value-of select="marc:subfield[@code='y']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-note">
-         <xsl:value-of select="marc:subfield[@code='z']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='773']">
-       <pz:metadata type="citation">
-         <xsl:for-each select="*">
-           <xsl:value-of select="normalize-space(.)"/>
-           <xsl:text> </xsl:text>
-         </xsl:for-each>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-       <xsl:value-of select="$medium"/>
-      </pz:metadata>
-
-      <xsl:if test="$fulltext_a">
-       <pz:metadata type="fulltext">
-         <xsl:value-of select="$fulltext_a"/>
-       </pz:metadata>
-      </xsl:if>
-
-      <xsl:if test="$fulltext_b">
-       <pz:metadata type="fulltext">
-         <xsl:value-of select="$fulltext_b"/>
-       </pz:metadata>
-      </xsl:if>
-
-      <xsl:if test="$open_url_resolver">
-        <pz:metadata type="open-url">
-            <xsl:call-template name="insert-md-openurl" />
-        </pz:metadata>
-      </xsl:if>
-
-    </pz:record>
-
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/etc/dc.xsl b/etc/dc.xsl
deleted file mode 100644 (file)
index d9ae36d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    This stylesheet expects oai/dc records
--->
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:dcterms="http://purl.org/dc/terms/">
-
- <xsl:output indent="yes"
-        method="xml"
-        version="1.0"
-        encoding="UTF-8"/>
-
-  <xsl:param name="medium" />
-
-  <xsl:template match="/*">
-    <pz:record>
-
-      <pz:metadata type="id">
-        <xsl:value-of select="dc:identifier"/>
-      </pz:metadata>
-
-      <xsl:for-each select="dc:title">
-        <pz:metadata type="title">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:date">
-        <pz:metadata type="date">
-         <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:subject">
-        <pz:metadata type="subject">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:creator">
-             <pz:metadata type="author">
-          <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:description">
-        <pz:metadata type="description">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:identifier">
-        <pz:metadata type="electronic-url">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:type">
-        <pz:metadata type="medium">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dcterms:bibliographicCitation">
-        <pz:metadata type="citation">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-        <xsl:value-of select="$medium" />
-      </pz:metadata>
-
-    </pz:record>
-  </xsl:template>
-
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/dkabm.xsl b/etc/dkabm.xsl
deleted file mode 100644 (file)
index ca135b6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    This stylesheet expects dkabm collection records as returned
-    from DBC's OpenSearch service.
--->
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:dcterms="http://purl.org/dc/terms/"
-    xmlns:dkabm="http://biblstandard.dk/abm/namespace/dkabm/"
-    xmlns:os="http://oss.dbc.dk/ns/opensearch">
-
- <xsl:output indent="yes"
-        method="xml"
-        version="1.0"
-        encoding="UTF-8"/>
-
-  <xsl:param name="medium" />
-
-  <xsl:template match="/">
-    <pz:cluster>
-      <xsl:apply-templates/>
-    </pz:cluster>
-  </xsl:template>
-
-  <xsl:template match="os:object">
-    <pz:record>
-      <xsl:apply-templates/>
-    </pz:record>
-  </xsl:template>
-
-  <xsl:template match="os:score">
-    <pz:metadata type="score">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="dkabm:record">
-
-      <pz:metadata type="id">
-        <xsl:value-of select="dc:identifier"/>
-      </pz:metadata>
-
-      <xsl:for-each select="dc:title">
-        <pz:metadata type="title">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:date">
-        <pz:metadata type="date">
-         <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:subject">
-        <pz:metadata type="subject">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:creator">
-             <pz:metadata type="author">
-          <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:description">
-        <pz:metadata type="description">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:identifier">
-        <pz:metadata type="electronic-url">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:type">
-        <pz:metadata type="medium">
-               <xsl:value-of select="."/>
-             </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dcterms:bibliographicCitation">
-        <pz:metadata type="citation">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-        <xsl:value-of select="$medium" />
-      </pz:metadata>
-
-  </xsl:template>
-
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/marc21-ourl.xsl b/etc/marc21-ourl.xsl
deleted file mode 100644 (file)
index 804c153..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-
-  
-  <xsl:import href="marc21.xsl" />
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-  <xsl:include href="pz2-ourl-marc21.xsl" />
-
-  <xsl:template name="record-hook">
-   Our hook
-      <xsl:if test="$open_url_resolver">
-        <pz:metadata type="open-url">
-            <xsl:call-template name="insert-md-openurl" />
-        </pz:metadata>
-      </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/etc/marc21.xsl b/etc/marc21.xsl
deleted file mode 100644 (file)
index e7bee0c..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-  
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<!-- Extract metadata from MARC21/USMARC 
-      http://www.loc.gov/marc/bibliographic/ecbdhome.html
--->  
-  <xsl:template name="record-hook"/>
-
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="marc:collection">
-    <pz:collection>
-        <xsl:apply-templates/>
-    </pz:collection>
-  </xsl:template>
-
-  <xsl:template match="marc:record">
-    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
-    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
-    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
-    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
-    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
-    <xsl:variable name="medium">
-      <xsl:choose>
-       <xsl:when test="$title_medium">
-         <xsl:value-of select="translate($title_medium, ' []/', '')"/>
-       </xsl:when>
-       <xsl:when test="$fulltext_a">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$fulltext_b">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$journal_title">
-         <xsl:text>article</xsl:text>
-       </xsl:when>
-       <xsl:otherwise>
-         <xsl:text>book</xsl:text>
-       </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="has_fulltext">
-      <xsl:choose>
-        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='q']">
-          <xsl:text>yes</xsl:text>
-        </xsl:when>
-        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='i']='TEXT*'">
-          <xsl:text>yes</xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>no</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="oclc_number">
-      <xsl:variable name="c001" select='marc:controlfield[@tag="001"]' />
-      <xsl:choose>
-        <xsl:when test='contains(marc:controlfield[@tag="001"],"ocn") or
-                        contains(marc:controlfield[@tag="001"],"ocm") or
-                        contains(marc:controlfield[@tag="001"],"OCoLC")'>
-            <xsl:value-of select="marc:controlfield[@tag='001']"/>
-        </xsl:when>
-        <xsl:when test='contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"ocn") or
-                        contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"ocm") or
-                        contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"OCoLC") '>
-         <xsl:value-of select="marc:datafield[@tag='035']/marc:subfield[@code='a']"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="date_008">
-      <xsl:choose>
-        <xsl:when test="contains('cestpudikmr', substring(marc:controlfield[@tag='008'], 7, 1))">
-          <xsl:value-of select="substring(marc:controlfield[@tag='008'], 8, 4)" />
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="date_end_008">
-      <xsl:choose>
-        <xsl:when test="contains('dikmr', substring(marc:controlfield[@tag='008'], 7, 1))">
-          <xsl:value-of select="substring(marc:controlfield[@tag='008'], 12, 4)" />
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <pz:record>
-      <xsl:for-each select="marc:controlfield[@tag='001']">
-        <pz:metadata type="id">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="oclc-number">
-        <xsl:value-of select="$oclc_number" />
-      </pz:metadata>
-
-      <xsl:for-each select="marc:datafield[@tag='010']">
-        <pz:metadata type="lccn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='020']">
-        <pz:metadata type="isbn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='022']">
-        <pz:metadata type="issn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='027']">
-        <pz:metadata type="tech-rep-nr">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='035']">
-        <pz:metadata type="system-control-nr">
-          <xsl:choose>
-            <xsl:when test="marc:subfield[@code='a']">
-              <xsl:value-of select="marc:subfield[@code='a']"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="marc:subfield[@code='b']"/>
-            </xsl:otherwise>
-          </xsl:choose>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='100']">
-       <pz:metadata type="author">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="author-title">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="author-date">
-         <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='110']">
-       <pz:metadata type="corporate-name">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="corporate-location">
-           <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="corporate-date">
-           <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='111']">
-       <pz:metadata type="meeting-name">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="meeting-location">
-           <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="meeting-date">
-           <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='130']">
-        <pz:metadata type="title-uniform">
-          <xsl:value-of select="marc:subfield[@code='a']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-media">
-          <xsl:value-of select="marc:subfield[@code='m']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-parts">
-          <xsl:value-of select="marc:subfield[@code='n']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-partname">
-          <xsl:value-of select="marc:subfield[@code='p']" />
-        </pz:metadata>
-        <pz:metadata type="title-uniform-key">
-          <xsl:value-of select="marc:subfield[@code='r']" />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='260']">
-        <pz:metadata type="date">
-          <xsl:value-of select="translate(marc:subfield[@code='c'], 'cp[].', '')" />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:if test="$date_008 and not(marc:datafield[@tag='260'])">
-        <pz:metadata type="date">
-          <xsl:choose>
-            <xsl:when test="$date_end_008">
-              <xsl:value-of select="concat($date_008,'-',$date_end_008)" />
-            </xsl:when>
-            <xsl:otherwise> 
-              <xsl:value-of select="$date_008" />
-            </xsl:otherwise>
-          </xsl:choose>
-        </pz:metadata>
-      </xsl:if>
-
-      <xsl:for-each select="marc:datafield[@tag='245']">
-        <pz:metadata type="title">
-          <xsl:value-of select="marc:subfield[@code='a']"/>
-        </pz:metadata>
-        <pz:metadata type="title-remainder">
-          <xsl:value-of select="marc:subfield[@code='b']"/>
-        </pz:metadata>
-        <pz:metadata type="title-responsibility">
-          <xsl:value-of select="marc:subfield[@code='c']"/>
-        </pz:metadata>
-        <pz:metadata type="title-dates">
-          <xsl:value-of select="marc:subfield[@code='f']"/>
-        </pz:metadata>
-        <pz:metadata type="title-medium">
-          <xsl:value-of select="marc:subfield[@code='h']"/>
-        </pz:metadata>
-        <pz:metadata type="title-number-section">
-          <xsl:value-of select="marc:subfield[@code='n']"/>
-        </pz:metadata>
-        <pz:metadata type="title-complete">
-          <xsl:value-of select="marc:subfield[@code='a']" />
-          <xsl:if test="marc:subfield[@code='b']" ><xsl:value-of select="concat(' ', marc:subfield[@code='b'])" /></xsl:if>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='250']">
-       <pz:metadata type="edition">
-           <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='260']">
-        <pz:metadata type="publication-place">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-        <pz:metadata type="publication-name">
-         <xsl:value-of select="marc:subfield[@code='b']"/>
-       </pz:metadata>
-        <pz:metadata type="publication-date">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='300']">
-       <pz:metadata type="physical-extent">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-format">
-         <xsl:value-of select="marc:subfield[@code='b']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-dimensions">
-         <xsl:value-of select="marc:subfield[@code='c']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-accomp">
-         <xsl:value-of select="marc:subfield[@code='e']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-unittype">
-         <xsl:value-of select="marc:subfield[@code='f']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-unitsize">
-         <xsl:value-of select="marc:subfield[@code='g']"/>
-       </pz:metadata>
-       <pz:metadata type="physical-specified">
-         <xsl:value-of select="marc:subfield[@code='3']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='440']">
-       <pz:metadata type="series-title">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag = '500' or @tag = '505' or
-               @tag = '518' or @tag = '520' or @tag = '522']">
-       <pz:metadata type="description">
-            <xsl:value-of select="*/text()"/>
-        </pz:metadata>
-      </xsl:for-each>
-
-       <xsl:for-each
-               select="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
-               <pz:metadata type="subject">
-                       <xsl:value-of select="marc:subfield[@code='a']" />
-               </pz:metadata>
-               <pz:metadata type="subject-long">
-                       <xsl:for-each select="node()/text()">
-                               <xsl:if test="position() > 1">
-                                       <xsl:text>, </xsl:text>
-                               </xsl:if>
-                               <xsl:variable name='value'>
-                                       <xsl:value-of select='normalize-space(.)' />
-                               </xsl:variable>
-                               <xsl:choose>
-                                       <xsl:when test="substring($value,string-length($value)) = ','">
-                                               <xsl:value-of select="substring($value,1,string-length($value)-1)" />
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of select="$value" />
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </xsl:for-each>
-               </pz:metadata>
-       </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='856']">
-       <pz:metadata type="electronic-url">
-         <xsl:value-of select="marc:subfield[@code='u']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-text">
-         <xsl:value-of select="marc:subfield[@code='y' or @code='3' or @code='a']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-note">
-         <xsl:value-of select="marc:subfield[@code='z']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-format-instruction">
-         <xsl:value-of select="marc:subfield[@code='i']"/>
-       </pz:metadata>
-       <pz:metadata type="electronic-format-type">
-         <xsl:value-of select="marc:subfield[@code='q']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='773']">
-       <pz:metadata type="citation">
-             <xsl:for-each select="*">
-               <xsl:value-of select="normalize-space(.)"/>
-               <xsl:text> </xsl:text>
-         </xsl:for-each>
-        </pz:metadata>
-        <xsl:if test="marc:subfield[@code='t']">
-         <pz:metadata type="journal-title">
-               <xsl:value-of select="marc:subfield[@code='t']"/>
-          </pz:metadata>          
-        </xsl:if>
-        <xsl:if test="marc:subfield[@code='g']">
-         <pz:metadata type="journal-subpart">
-               <xsl:value-of select="marc:subfield[@code='g']"/>
-          </pz:metadata>          
-        </xsl:if>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='852']">
-        <xsl:if test="marc:subfield[@code='y']">
-         <pz:metadata type="publicnote">
-           <xsl:value-of select="marc:subfield[@code='y']"/>
-         </pz:metadata>
-       </xsl:if>
-       <xsl:if test="marc:subfield[@code='h']">
-         <pz:metadata type="callnumber">
-           <xsl:value-of select="marc:subfield[@code='h']"/>
-         </pz:metadata>
-       </xsl:if>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='a']">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-        <xsl:value-of select="$medium"/>
-      </pz:metadata>
-
-      <pz:metadata type="has-fulltext">
-        <xsl:value-of select="$has_fulltext"/> 
-      </pz:metadata>
-
-      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='b']">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <!-- <xsl:if test="$fulltext_b">
-       <pz:metadata type="fulltext">
-         <xsl:value-of select="$fulltext_b"/>
-       </pz:metadata>
-      </xsl:if> -->
-
-      <xsl:for-each select="marc:datafield[@tag='907' or @tag='901']">
-        <pz:metadata type="iii-id">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='926']">
-        <pz:metadata type="holding">
-         <xsl:for-each select="marc:subfield">
-           <xsl:if test="position() > 1">
-             <xsl:text> </xsl:text>
-           </xsl:if>
-           <xsl:value-of select="."/>
-         </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='948']">
-        <pz:metadata type="holding">
-         <xsl:for-each select="marc:subfield">
-           <xsl:if test="position() > 1">
-             <xsl:text> </xsl:text>
-           </xsl:if>
-           <xsl:value-of select="."/>
-         </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='991']">
-        <pz:metadata type="holding">
-         <xsl:for-each select="marc:subfield">
-           <xsl:if test="position() > 1">
-             <xsl:text> </xsl:text>
-           </xsl:if>
-           <xsl:value-of select="."/>
-         </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='999']">
-        <pz:metadata type="localid">
-          <xsl:choose>
-            <xsl:when test="marc:subfield[@code='a']">
-              <xsl:value-of select="marc:subfield[@code='a']"/>
-            </xsl:when>
-            <xsl:when test="marc:subfield[@code='c']">
-              <xsl:value-of select="marc:subfield[@code='c']"/>
-            </xsl:when> 
-            <xsl:otherwise>
-              <xsl:value-of select="marc:subfield[@code='d']"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <!-- passthrough id data -->
-      <xsl:for-each select="pz:metadata">
-          <xsl:copy-of select="."/>
-      </xsl:for-each>
-
-      <!-- other stylesheets importing this might want to define this -->
-      <xsl:call-template name="record-hook"/>
-
-    </pz:record>    
-  </xsl:template>
-  
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/marc22.xsl b/etc/marc22.xsl
deleted file mode 100644 (file)
index 02e34e0..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-  
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<!-- Extract metadata from MARC21/USMARC 
-      http://www.loc.gov/marc/bibliographic/ecbdhome.html
--->  
-  <xsl:template name="record-hook"/>
-
-  <xsl:template match="/">
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="marc:record">
-    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
-    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
-    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
-    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
-    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
-    <xsl:variable name="medium">
-      <xsl:choose>
-       <xsl:when test="$title_medium">
-         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
-       </xsl:when>
-       <xsl:when test="$fulltext_a">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$fulltext_b">
-         <xsl:text>electronic resource</xsl:text>
-       </xsl:when>
-       <xsl:when test="$journal_title">
-         <xsl:text>article</xsl:text>
-       </xsl:when>
-       <xsl:otherwise>
-         <xsl:text>book</xsl:text>
-       </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <pz:record>
-
-      <pz:metadata type="medium">
-       <xsl:value-of select="$medium"/>
-      </pz:metadata>
-
-      <xsl:apply-templates/>
-
-      <!-- other stylesheets importing this might want to define this -->
-      <xsl:call-template name="record-hook"/>
-
-    </pz:record>    
-  </xsl:template>
-
-  <xsl:template match="marc:controlfield[@tag='001']">
-    <pz:metadata type="id">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='010']">
-    <pz:metadata type="lccn">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='020']">
-    <pz:metadata type="isbn">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-  
-  <!-- does ANYONE need this?
-  <xsl:template match="marc:datafield[@tag='027']">
-    <pz:metadata type="tech-rep-nr">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-  -->
-  
-  <xsl:template match="marc:datafield[@tag='035']">
-    <pz:metadata type="system-control-nr">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-  
-  <xsl:template match="marc:datafield[@tag='100' or @tag='700']">
-    <pz:metadata type="author">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="author-title">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="author-date">
-      <xsl:value-of select="marc:subfield[@code='d']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='110']">
-    <pz:metadata type="corporate-name">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="corporate-location">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="corporate-date">
-      <xsl:value-of select="marc:subfield[@code='d']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='111']">
-    <pz:metadata type="meeting-name">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="meeting-location">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="meeting-date">
-      <xsl:value-of select="marc:subfield[@code='d']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='245']">
-    <pz:metadata type="title">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="title-remainder">
-      <xsl:value-of select="marc:subfield[@code='b']"/>
-    </pz:metadata>
-    <pz:metadata type="title-responsibility">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="title-dates">
-      <xsl:value-of select="marc:subfield[@code='f']"/>
-    </pz:metadata>
-    <pz:metadata type="title-medium">
-      <xsl:value-of select="marc:subfield[@code='h']"/>
-    </pz:metadata>
-    <pz:metadata type="title-number-section">
-      <xsl:value-of select="marc:subfield[@code='n']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='250']">
-    <pz:metadata type="edition">
-       <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='260']">
-    <pz:metadata type="publication-place">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="publication-name">
-      <xsl:value-of select="marc:subfield[@code='b']"/>
-    </pz:metadata>
-    <pz:metadata type="publication-date">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="date">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='300']">
-    <pz:metadata type="physical-extent">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-format">
-      <xsl:value-of select="marc:subfield[@code='b']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-dimensions">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-accomp">
-      <xsl:value-of select="marc:subfield[@code='e']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-unittype">
-      <xsl:value-of select="marc:subfield[@code='f']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-unitsize">
-      <xsl:value-of select="marc:subfield[@code='g']"/>
-    </pz:metadata>
-    <pz:metadata type="physical-specified">
-      <xsl:value-of select="marc:subfield[@code='3']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='440']">
-    <pz:metadata type="series-title">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag = '500' or @tag = '505' or
-           @tag = '518' or @tag = '520' or @tag = '522']">
-    <pz:metadata type="description">
-       <xsl:value-of select="*/text()"/>
-    </pz:metadata>
-  </xsl:template>
-  
-  <xsl:template match="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
-    <pz:metadata type="subject">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-    <pz:metadata type="subject-long">
-      <xsl:for-each select="marc:subfield">
-       <xsl:if test="position() > 1">
-         <xsl:text>, </xsl:text>
-       </xsl:if>
-       <xsl:value-of select="."/>
-      </xsl:for-each>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='856']">
-    <pz:metadata type="electronic-url">
-      <xsl:value-of select="marc:subfield[@code='u']"/>
-    </pz:metadata>
-    <pz:metadata type="electronic-text">
-      <xsl:value-of select="marc:subfield[@code='y' or @code='3']"/>
-    </pz:metadata>
-    <pz:metadata type="electronic-note">
-      <xsl:value-of select="marc:subfield[@code='z']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='773']">
-    <pz:metadata type="citation">
-      <xsl:for-each select="*">
-       <xsl:value-of select="normalize-space(.)"/>
-       <xsl:text> </xsl:text>
-      </xsl:for-each>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='852']">
-    <xsl:if test="marc:subfield[@code='y']">
-      <pz:metadata type="publicnote">
-       <xsl:value-of select="marc:subfield[@code='y']"/>
-      </pz:metadata>
-    </xsl:if>
-    <xsl:if test="marc:subfield[@code='h']">
-      <pz:metadata type="callnumber">
-       <xsl:value-of select="marc:subfield[@code='h']"/>
-      </pz:metadata>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='900']/marc:subfield[@code='a']">
-    <pz:metadata type="fulltext">
-      <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='907' or @tag='901']">
-    <pz:metadata type="iii-id">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='926']">
-    <pz:metadata type="holding">
-      <xsl:for-each select="marc:subfield">
-       <xsl:if test="position() > 1">
-         <xsl:text> </xsl:text>
-       </xsl:if>
-       <xsl:value-of select="."/>
-      </xsl:for-each>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='948']">
-    <pz:metadata type="holding">
-      <xsl:for-each select="marc:subfield">
-       <xsl:if test="position() > 1">
-         <xsl:text> </xsl:text>
-       </xsl:if>
-       <xsl:value-of select="."/>
-      </xsl:for-each>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="marc:datafield[@tag='991']">
-    <pz:metadata type="holding">
-      <xsl:for-each select="marc:subfield">
-       <xsl:if test="position() > 1">
-         <xsl:text> </xsl:text>
-       </xsl:if>
-       <xsl:value-of select="."/>
-      </xsl:for-each>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="pz:metadata">
-      <xsl:copy-of select="."/>
-  </xsl:template>
-
-      <!-- other stylesheets importing this might want to define this -->
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/oai_dc.xsl b/etc/oai_dc.xsl
deleted file mode 100644 (file)
index 36757cc..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    This stylesheet expects oai/dc records
--->
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:oai="http://www.openarchives.org/OAI/2.0/"
-    xmlns:dc="http://purl.org/dc/elements/1.1/"
-    xmlns:dcterms="http://purl.org/dc/terms/">
-
- <xsl:output indent="yes"
-        method="xml"
-        version="1.0"
-        encoding="UTF-8"/>
-
-
-
-  <xsl:template match="/oai:record/oai:metadata/*">
-    <pz:record>
-
-      <pz:metadata type="id">
-        <xsl:value-of select="/oai:record/oai:header/oai:identifier"/>
-      </pz:metadata>
-
-      <xsl:for-each select="dc:title">
-        <pz:metadata type="title">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:date">
-        <pz:metadata type="date">
-         <xsl:value-of select="."/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:subject">
-        <pz:metadata type="subject">
-         <xsl:value-of select="."/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:creator">
-       <pz:metadata type="author">
-          <xsl:value-of select="."/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:description">
-        <pz:metadata type="description">
-         <xsl:value-of select="."/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:identifier">
-        <pz:metadata type="electronic-url">
-         <xsl:value-of select="."/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dc:type">
-        <pz:metadata type="medium">
-             <xsl:value-of select="."/>
-           </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="dcterms:bibliographicCitation">
-        <pz:metadata type="citation">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-    </pz:record>
-  </xsl:template>
-
-
-  <xsl:template match="text()"/>
-
-</xsl:stylesheet>
diff --git a/etc/opac.xsl b/etc/opac.xsl
deleted file mode 100644 (file)
index dd5c789..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-  
-  <xsl:import href="marc21.xsl"/>
-
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<!-- Extract metadata from OPAC records with embedded MAR records
-      http://www.loc.gov/marc/bibliographic/ecbdhome.html
--->  
-
-  <xsl:template name="record-hook">
-    <xsl:for-each select="/opacRecord/holdings/holding">
-      <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="localLocation"/>
-      </pz:metadata>
-      <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="callNumber"/>
-      </pz:metadata>
-      <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="publicNote"/>
-      </pz:metadata>
-      <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
-        <xsl:choose>
-          <xsl:when test="circulations/circulation/availableNow/@value = '1'">
-             Available
-          </xsl:when>
-          <xsl:when test="circulations/circulation/availableNow/@value = '0'">
-           <xsl:value-of select="circulations/circulation/availabiltyDate"/>
-         </xsl:when>
-        </xsl:choose>
-      </pz:metadata>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="/">
-    <xsl:choose>
-      <xsl:when test="opacRecord">
-        <xsl:apply-templates select="opacRecord/bibliographicRecord"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/etc/opac_turbomarc.xsl b/etc/opac_turbomarc.xsl
deleted file mode 100644 (file)
index 98f33b7..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.indexdata.com/turbomarc">
-  
-  <xsl:import href="tmarc.xsl"/>
-
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-<!-- Extract metadata from OPAC records with embedded MAR records
-      http://www.loc.gov/marc/bibliographic/ecbdhome.html
--->  
-
-  <xsl:template name="record-hook">
-    <xsl:for-each select="/opacRecord/holdings/holding">
-      <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="localLocation"/>
-      </pz:metadata>
-      <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="callNumber"/>
-      </pz:metadata>
-      <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
-       <xsl:value-of select="publicNote"/>
-      </pz:metadata>
-      <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
-        <xsl:choose>
-          <xsl:when test="circulations/circulation/availableNow/@value = '1'">
-             Available
-          </xsl:when>
-          <xsl:when test="circulations/circulation/availableNow/@value = '0'">
-           <xsl:value-of select="circulations/circulation/availabiltyDate"/>
-         </xsl:when>
-        </xsl:choose>
-      </pz:metadata>
-    </xsl:for-each>
-  </xsl:template>
-  <xsl:template match="/">
-    <xsl:choose>
-      <xsl:when test="opacRecord">
-        <xsl:apply-templates select="opacRecord/bibliographicRecord"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-</xsl:stylesheet>
index e1ed332..65dad25 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
-  
+
+  <file path=".:xsl"/>  
   <server>
     <listen port="9004"/>
     <include src="default.xml"/>
index 1678574..943f639 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
 
+  <file path=".:xsl"/> 
   <threads number="10"/>
   <server id="metasearch_threaded">
     <listen port="9005"/>
diff --git a/etc/pp2out-to-carrot2.xsl b/etc/pp2out-to-carrot2.xsl
deleted file mode 100644 (file)
index 5bdd7a0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-<xsl:template match="/">
-  <searchresult>
-    <!-- TODO make query an xsl parameter -->
-    <query>water</query>
-    <xsl:for-each select="show/hit">
-    <document>
-      <xsl:attribute name="id">
-        <xsl:value-of select="recid" />
-      </xsl:attribute>
-      <title><xsl:value-of select="md-title" /></title>
-      <url><xsl:value-of select="location/md-electronic-url" /></url>
-      <snippet xml:space="preserve">
-        <xsl:for-each select="md-description">
-          <xsl:value-of select="." />
-        </xsl:for-each>
-        <xsl:value-of select="md-title-responsibility" />
-      </snippet>
-    </document> 
-    </xsl:for-each>
-  </searchresult>
-</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
diff --git a/etc/primo-pz2.xsl b/etc/primo-pz2.xsl
deleted file mode 100644 (file)
index 43a92a1..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-  xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-  xmlns:tmarc="http://www.indexdata.com/turbomarc"
-  xmlns:prim="http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib" 
-  xmlns:sear="http://www.exlibrisgroup.com/xsd/jaguar/search"
->
-
-  <xsl:output indent="yes" method="xml" version="1.0"
-    encoding="UTF-8" />
-
-  <xsl:template name="record-hook" />
-
-  <xsl:variable name="type" select="/opt/prim:PrimoNMBib/prim:display/prim:type"/>
-  <xsl:variable name="is_article" select="$type = 'article'" />
-  <xsl:variable name="fulltext" select="/opt/prim:PrimoNMBib/prim:delivery/prim:fulltext"/>
-  <xsl:variable name="has_fulltext">
-    <xsl:choose>
-      <xsl:when test="$fulltext = 'no_fulltext' ">
-        <xsl:text>no</xsl:text>
-      </xsl:when>
-      <xsl:when test="$fulltext = 'fulltext'">
-        <xsl:text>yes</xsl:text>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:text>no</xsl:text>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <xsl:template match="/">
-    <xsl:apply-templates />
-  </xsl:template>
-
-  <xsl:template match="sear:RESULT">
-    <pz:records>
-      <xsl:apply-templates />
-    </pz:records>
-  </xsl:template>
-
-  <xsl:template match="sear:DOC">
-    <pz:record>
-      <xsl:apply-templates />
-    </pz:record>
-  </xsl:template>
-
-  <xsl:template match="prim:PrimoNMBib">
-    <xsl:apply-templates />
-  </xsl:template>
-  
-  <xsl:template match="prim:control"> 
-    <xsl:for-each select="prim:recordid">
-      <pz:metadata type="id">
-       <xsl:value-of select="."/>
-      </pz:metadata>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="prim:addata">
-    <!--    <xsl:variable name="yearmonthday" select="@date" /> -->
-
-    <xsl:for-each select="prim:date">
-      <pz:metadata type="date">
-       <xsl:value-of select="substring(.,1,4)" />
-      </pz:metadata>
-      <pz:metadata type="journal-month">
-       <xsl:value-of select="substring(.,4,1)" />
-      </pz:metadata>
-    </xsl:for-each>
-
-    <xsl:for-each select="prim:volume">
-      <pz:metadata type="journal-number">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-
-    <xsl:for-each select="prim:issue">
-      <pz:metadata type="issue-number">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-
-    <xsl:for-each select="prim:issn">
-      <pz:metadata type="issn">
-        <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-
-    <xsl:for-each select="prim:jtitle">
-      <pz:metadata type="journal-title">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="prim:delivery">  
-
-    <xsl:if test="$has_fulltext">
-      <pz:metadata type="has-fulltext">
-        <xsl:value-of select="$has_fulltext" />
-      </pz:metadata>
-    </xsl:if>
-
-  </xsl:template>
-
-  <xsl:template match="prim:display">
-    <xsl:for-each select="prim:creator">
-       <pz:metadata type="author">
-        <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>  
-    <xsl:for-each select="prim:type">
-      <xsl:variable name="type" select="."/>
-      <pz:metadata type="medium">
-       <xsl:choose>
-          <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
-           <xsl:text>e-article</xsl:text>
-         </xsl:when>
-          <xsl:when  test="$type = 'article' and $has_fulltext = 'no'">
-           <xsl:text>article</xsl:text>
-         </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="$type"/>
-          </xsl:otherwise>
-       </xsl:choose>
-<!--        <xsl:value-of select="$type" /> -->
-      </pz:metadata>
-      <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
-    </xsl:for-each>  
-
-    <xsl:for-each select="prim:title">
-      <pz:metadata type="title">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>  
-
-    <xsl:for-each select="prim:ispartof">
-      <pz:metadata type="journal-subpart">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-<!--
-    <xsl:apply-templates />
--->
-  </xsl:template>
-
-  <xsl:template match="prim:facets">
-    <xsl:for-each select="prim:topic">
-       <pz:metadata type="subject">
-        <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>  
-  </xsl:template>
-
-  <xsl:template match="sear:LINKS" >
-    <xsl:for-each select="sear:openurl"> 
-      <pz:metadata type="electronic-url">
-       <xsl:value-of select="."/>
-      </pz:metadata>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="prim:search">
-    <xsl:for-each select="prim:description">
-      <pz:metadata type="description">
-       <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-
-
-    <xsl:for-each select="prim:sub">
-      <pz:metadata type="subject">
-        <xsl:value-of select="." />
-      </pz:metadata>
-    </xsl:for-each>
-
-    <!-- passthrough id data -->
-    <xsl:for-each select="pz:metadata">
-      <xsl:copy-of select="." />
-    </xsl:for-each>
-    <!-- other stylesheets importing this might want to define this -->
-
-    <xsl:call-template name="record-hook" />   
-  </xsl:template>
-
-  <xsl:template match="text()" />
-
-</xsl:stylesheet>
diff --git a/etc/pz2-ourl-base.xsl b/etc/pz2-ourl-base.xsl
deleted file mode 100644 (file)
index 260dc9f..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim"
-    xmlns:str="http://exslt.org/strings"
-    extension-element-prefixes="str">
-
-  <xsl:param name="open_url_resolver"/>
-  <!--<xsl:variable name="resolver">http://zeus.lib.uoc.gr:3210/sfxtst3</xsl:variable>-->
-  <xsl:template name="insert-md-openurl">
-  
-    <xsl:value-of select="$open_url_resolver" /><xsl:text>?generatedby=pz2</xsl:text>
-    <xsl:call-template name="ou-parse-author" />
-    <xsl:call-template name="ou-parse-date" />
-    <xsl:call-template name="ou-parse-volume" />
-    <xsl:call-template name="ou-parse-any">
-      <xsl:with-param name="field_name" select="string('isbn')" />
-    </xsl:call-template>
-    <xsl:call-template name="ou-parse-any">
-      <xsl:with-param name="field_name" select="string('issn')" />
-    </xsl:call-template>
-    <xsl:call-template name="ou-parse-any">
-      <xsl:with-param name="field_name" select="string('title')" />
-    </xsl:call-template>
-    <xsl:call-template name="ou-parse-any">
-      <xsl:with-param name="field_name" select="string('atitle')" />
-    </xsl:call-template>
-
-  </xsl:template>
-  <!-- parsing raw string data -->
-  
-  <xsl:template name="ou-parse-author" >
-    <xsl:variable name="author">
-      <xsl:call-template name="ou-author" />
-    </xsl:variable>
-    
-    <xsl:variable name="aulast" select="normalize-space(substring-before($author, ','))"/>
-
-    <xsl:variable name="aufirst" 
-      select="substring-before( normalize-space(substring-after($author, ',')), ' ')"/>
-
-    <xsl:if test="$aulast != ''">
-      <xsl:text>&amp;aulast=</xsl:text>
-      <xsl:value-of select="$aulast" />
-    </xsl:if>
-
-    <xsl:if test="string-length( translate($aufirst, '.', '') ) &gt; 1" >
-      <xsl:text>&amp;aufirst=</xsl:text>
-      <xsl:value-of select="$aufirst" />
-    </xsl:if>
-
-  </xsl:template>
-
-  <xsl:template name="ou-parse-volume">
-    <xsl:variable name="volume">
-      <xsl:call-template name="ou-volume" />
-    </xsl:variable>
-
-    <xsl:variable name="vol" select="substring-after($volume, 'Vol')"/>
-    <xsl:variable name="issue" select="false()" />
-    <xsl:variable name="spage" select="false()" />
-
-    <xsl:if test="$vol">
-      <xsl:text>&amp;volume=</xsl:text>
-      <xsl:value-of select="$vol" />
-    </xsl:if>
-
-    <xsl:if test="$issue">
-      <xsl:text>&amp;issue=</xsl:text>
-      <xsl:value-of select="$issue" />
-    </xsl:if>
-    
-    <xsl:if test="$spage">
-      <xsl:text>&amp;spage=</xsl:text>
-      <xsl:value-of select="$vol" />
-    </xsl:if>
-
-  </xsl:template>
-
-
-  <xsl:template name="ou-parse-date">
-    <xsl:variable name="date">
-      <xsl:call-template name="ou-date" />
-    </xsl:variable>
-
-    <xsl:variable name="parsed_date" select="translate($date, '.[]c;', '')"/>
-
-    <xsl:if test="$parsed_date">
-      <xsl:text>&amp;date=</xsl:text>
-      <xsl:value-of select="$parsed_date" />
-    </xsl:if>
-
-  </xsl:template>
-
-  
-  <xsl:template name="ou-parse-any">
-    <xsl:param name="field_name" />
-
-    <xsl:variable name="field_value">
-      <xsl:choose>
-
-      <xsl:when test="$field_name = 'isbn'">
-        <xsl:call-template name="ou-isbn"/>
-      </xsl:when>
-
-      <xsl:when test="$field_name = 'issn'">
-        <xsl:call-template name="ou-issn"/>
-      </xsl:when>
-      
-      <xsl:when test="$field_name = 'atitle'">
-        <xsl:call-template name="ou-atitle"/>
-      </xsl:when>
-     
-      <xsl:when test="$field_name = 'title'">
-        <xsl:call-template name="ou-title"/>
-      </xsl:when>
-
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="digits" select="1234567890"/>
-
-    <xsl:variable name="parsed_value">
-      <xsl:choose>
-
-      <xsl:when test="$field_name = 'isbn'">
-        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, 'X'), ''), '')"/>
-      </xsl:when>
-
-      <xsl:when test="$field_name = 'issn'">
-        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, '-', 'X'), ''), '')"/>
-      </xsl:when>
-      
-      <xsl:when test="$field_name = 'atitle'">
-        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
-      </xsl:when>
-     
-      <xsl:when test="$field_name = 'title'">
-        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
-      </xsl:when>
-
-      </xsl:choose>
-    </xsl:variable>
-
-
-    <xsl:if test="$parsed_value != ''">
-      <xsl:text>&amp;</xsl:text>
-      <xsl:value-of select="$field_name" />
-      <xsl:text>=</xsl:text>
-      <xsl:value-of select="$parsed_value" />
-    </xsl:if>
-
-  </xsl:template>
-
-
-</xsl:stylesheet>
-<!--
-/*
- * Local variables:
- * c-basic-offset: 2
- * indent-tabs-mode: nil
- * End:
- * vim: shiftwidth=2 tabstop=4 expandtab
- */
--->
diff --git a/etc/pz2-ourl-marc21.xsl b/etc/pz2-ourl-marc21.xsl
deleted file mode 100644 (file)
index 1c8efde..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim"
-    xmlns:str="http://exslt.org/strings"
-    extension-element-prefixes="str">  
-  
-  <xsl:import href="pz2-ourl-base.xsl"/>
-
-  <xsl:template name="ou-author" >
-  <!-- what to do with multiple authors??-->
-    <xsl:for-each select="marc:datafield[@tag='100' or @tag='700']">
-      <xsl:value-of select="marc:subfield[@code='a']"/>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template name="ou-title" >
-  <!-- if 773 exists its a journal/article -->
-    <xsl:choose>
-    
-      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='t']">
-        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
-      </xsl:when>
-
-      <xsl:when test="marc:datafield[@tag='245']/marc:subfield[@code='a']">
-        <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
-      </xsl:when>
-
-    </xsl:choose>
-  </xsl:template>
-
-  
-  <xsl:template name="ou-atitle" >
-    <!-- return value only if article or journal -->
-    <xsl:if test="marc:datafield[@tag='773']">
-      <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
-    </xsl:if>
-  </xsl:template>
-
-
-  <xsl:template name="ou-date" >
-    <xsl:for-each select="marc:datafield[@tag='260']">
-      <xsl:value-of select="marc:subfield[@code='c']"/>
-    </xsl:for-each>
-  </xsl:template>
-
-  
-  <xsl:template name="ou-isbn" >
-  <!-- if 773 exists its a journal/article -->
-    <xsl:choose>  
-    
-      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='z']">
-        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='z']"/>
-      </xsl:when>
-      
-      <xsl:when test="marc:datafield[@tag='020']/marc:subfield[@code='a']">
-        <xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/>
-      </xsl:when>
-
-    </xsl:choose>
-  </xsl:template>
-
-  
-  <xsl:template name="ou-issn" >
-  <!-- if 773 exists its a journal/article -->
-    <xsl:choose>
-    
-      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='x']">
-        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='x']"/>
-      </xsl:when>
-
-      <xsl:when test="marc:datafield[@tag='022']/marc:subfield[@code='a']">
-        <xsl:value-of select="marc:datafield[@tag='022']/marc:subfield[@code='a']"/>
-      </xsl:when>
-
-      </xsl:choose>
-  </xsl:template>
-
-  
-  <xsl:template name="ou-volume" >
-    <xsl:if test="marc:datafield[@tag='773']">
-         <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='g']"/>
-    </xsl:if>
-  </xsl:template>
-
-</xsl:stylesheet>
-<!--
-/*
- * Local variables:
- * c-basic-offset: 2
- * indent-tabs-mode: nil
- * End:
- * vim: shiftwidth=2 tabstop=4 expandtab
- */
--->
diff --git a/etc/pz2-solr.xsl b/etc/pz2-solr.xsl
deleted file mode 100644 (file)
index 0b7b796..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-               xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
-  <xsl:template  match="/">
-    <add>
-      <xsl:apply-templates></xsl:apply-templates>
-    </add>
-  </xsl:template>
-
-  <xsl:template match="pz:record">
-    <doc>
-      <xsl:apply-templates></xsl:apply-templates>
-    </doc>
-  </xsl:template>
-  <xsl:template match="pz:metadata">
-    <xsl:if test="@type">
-      <field>
-       <xsl:attribute  name="name">
-         <xsl:value-of select="@type"/>
-       </xsl:attribute>
-       <xsl:value-of select="."/>
-      </field>
-    </xsl:if>
-  </xsl:template>
-</xsl:stylesheet>
index f2c404c..a808a7a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
-
   <threads number="0"/> <!-- non-zero to enable threaded operation -->
+  <file path=".:xsl"/> 
   <server>
     <listen port="8004"/>
 
diff --git a/etc/solr-pz2.xsl b/etc/solr-pz2.xsl
deleted file mode 100644 (file)
index f6fa5dd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-               xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
-
-  <xsl:param name="medium" />
-
-  <xsl:template  match="/">
-      <xsl:apply-templates></xsl:apply-templates>
-  </xsl:template>
-
-  <xsl:template  match="response">
-      <xsl:apply-templates></xsl:apply-templates>
-  </xsl:template>
-
-  <xsl:template  match="records">
-      <xsl:apply-templates></xsl:apply-templates>
-  </xsl:template>
-
-  <xsl:template match="doc">
-    <pz:record>
-      <xsl:if test="string-length($medium) &gt; 0">
-        <pz:metadata type="medium">
-           <xsl:value-of select="$medium"/>
-        </pz:metadata>
-      </xsl:if>
-      <xsl:apply-templates></xsl:apply-templates>
-    </pz:record>
-  </xsl:template>
-
-  <xsl:template match="float[@name]">
-    <pz:metadata>
-       <xsl:attribute  name="type">
-         <xsl:value-of select="@name"/>
-       </xsl:attribute>
-       <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="str[@name]">
-    <pz:metadata>
-       <xsl:attribute  name="type">
-         <xsl:value-of select="@name"/>
-       </xsl:attribute>
-       <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="date[@name]">
-    <pz:metadata>
-       <xsl:attribute  name="type">
-         <xsl:value-of select="@name"/>
-       </xsl:attribute>
-       <xsl:value-of select="."/>
-    </pz:metadata>
-  </xsl:template>
-
-  <xsl:template match="arr">
-    <xsl:for-each select="str">
-      <xsl:call-template name="string"/>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template name="string">
-      <pz:metadata>
-       <xsl:attribute  name="type">
-         <xsl:value-of select="../@name"/>
-       </xsl:attribute>
-       <xsl:choose>
-         <xsl:when test="../@name = 'medium' and string-length($medium) = 0">
-         </xsl:when>
-         <xsl:otherwise>
-           <xsl:value-of select="."/>
-         </xsl:otherwise>
-       </xsl:choose>
-      </pz:metadata>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/etc/tmarc.xsl b/etc/tmarc.xsl
deleted file mode 100644 (file)
index 95e9975..0000000
+++ /dev/null
@@ -1,829 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-  xmlns="http://www.indexdata.com/turbomarc"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-  xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-  xmlns:tmarc="http://www.indexdata.com/turbomarc">
-
-  <xsl:output indent="yes" method="xml" version="1.0"
-    encoding="UTF-8" />
-  <xsl:param name="medium"/>
-
-  <!-- Extract metadata from MARC21/USMARC from streamlined marcxml format 
-    http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
-  <xsl:template name="record-hook" />
-
-
-  <xsl:template match="/">
-      <xsl:apply-templates />
-  </xsl:template>
-
-  <xsl:template match="tmarc:collection">
-    <collection>
-      <xsl:apply-templates />
-    </collection>
-  </xsl:template>
-
-  <xsl:template match="tmarc:r">
-    <xsl:variable name="title_medium" select="tmarc:d245/tmarc:sh" />
-    <xsl:variable name="journal_title" select="tmarc:d773/tmarc:st" />
-    <xsl:variable name="electronic_location_url" select="tmarc:d856/tmarc:su" />
-    <xsl:variable name="fulltext_a" select="tmarc:d900/tmarc:sa" />
-    <xsl:variable name="fulltext_b" select="tmarc:d900/tmarc:sb" />
-    <!-- Does not always hit the right substring. The field is not always fixed-width? -->
-    <xsl:variable name="control_lang" select="substring(tmarc:c008, 36, 3)" />
-    <xsl:variable name="contains110" select="tmarc:d110" />
-    <xsl:variable name="hasAuthorFields" select="tmarc:d100 or tmarc:d111" />
-    <xsl:variable name="typeofrec" select="substring(tmarc:l, 7, 1)"/>
-    <xsl:variable name="typeofvm" select="substring(tmarc:c008, 34, 1)"/>
-    <xsl:variable name="biblevel" select="substring(tmarc:l, 8, 1)"/>
-    <xsl:variable name="physdes" select="substring(tmarc:c007, 1, 1)"/>
-    <xsl:variable name="form1" select="substring(tmarc:c008, 24, 1)"/>
-    <xsl:variable name="form2" select="substring(tmarc:c008, 30, 1)"/>
-    <xsl:variable name="oclca" select="substring(tmarc:c007, 1, 1)"/>
-    <xsl:variable name="oclcb" select="substring(tmarc:c007, 2, 1)"/>
-    <xsl:variable name="oclcd" select="substring(tmarc:c007, 4, 1)"/>
-    <xsl:variable name="oclce" select="substring(tmarc:c007, 5, 1)"/>
-    <xsl:variable name="typeofserial" select="substring(tmarc:c008, 22, 1)"/>
-
-    <xsl:variable name="electronic">
-      <xsl:choose>
-        <xsl:when test="$form1='s' or $form1='q' or $form1='o' or
-          $form2='s' or $form2='q' or $form2='o'">
-          <xsl:text>yes</xsl:text>
-       </xsl:when>
-       <xsl:otherwise/>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="vmedium">
-      <xsl:choose>
-        <xsl:when test="string-length($medium)"><xsl:value-of select="$medium" /></xsl:when>
-        <xsl:when test="($typeofrec='a' or $typeofrec='t') and $biblevel='m'">book</xsl:when>
-        <xsl:when test="$typeofrec='j' or $typeofrec='i'">
-         <xsl:text>recording</xsl:text>
-         <xsl:choose>
-           <xsl:when test="$oclcb='d' and $oclcd='f'">-cd</xsl:when>
-           <xsl:when test="$oclcb='s'">-cassette</xsl:when>
-           <xsl:when test="$oclcb='d' and $oclcd='a' or $oclcd='b' or
-             $oclcd='c' or $oclcd='d' or $oclcd='e'">-vinyl</xsl:when>
-         </xsl:choose>
-       </xsl:when>
-       <xsl:when test="$typeofrec='g'">
-         <xsl:choose>
-           <xsl:when test="$typeofvm='m' or $typeofvm='v'">
-             <xsl:text>video</xsl:text>
-             <xsl:choose>
-               <xsl:when test="$oclca='v' and $oclcb='d' and $oclce='v'">-dvd</xsl:when>
-               <xsl:when test="$oclca='v' and $oclcb='d' and $oclce='s'">-blu-ray</xsl:when>
-               <xsl:when test="$oclca='v' and $oclcb='f' and $oclce='b'">-vhs</xsl:when>
-             </xsl:choose>
-           </xsl:when>
-           <xsl:otherwise>audio-visual</xsl:otherwise>
-         </xsl:choose>
-       </xsl:when>
-       <xsl:when test="$typeofrec='a' and $biblevel='s'">
-         <xsl:choose>
-           <xsl:when test="$typeofserial='n'">newspaper</xsl:when>
-           <xsl:otherwise>journal</xsl:otherwise>
-         </xsl:choose>
-       </xsl:when>
-       <xsl:when test="$typeofrec='e' or $typeofrec='f'">map</xsl:when>
-       <xsl:when test="$typeofrec='c' or $typeofrec='d'">music-score</xsl:when>
-       <xsl:when test="$form1='a' or $form1='b' or $form1='c'">microform</xsl:when>
-       <xsl:when test="$typeofrec='t'">thesis</xsl:when>
-        <!-- <xsl:when test="$journal_title">article</xsl:when> -->
-       <xsl:when test="$typeofrec='a' or $typeofrec='i' and
-           ($typeofserial='d' or $typeofserial='w')">web</xsl:when>
-       <xsl:when test="$typeofrec='a' and $biblevel='b'">article</xsl:when>
-       <xsl:when test="$typeofrec='m'">electronic</xsl:when>
-        <xsl:otherwise>
-          <xsl:text>other</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="has_fulltext">
-      <xsl:choose>
-        <xsl:when test="tmarc:d856/tmarc:sq">
-          <xsl:text>yes</xsl:text>
-        </xsl:when>
-        <xsl:when test="tmarc:d856/tmarc:si='TEXT*'">
-          <xsl:text>yes</xsl:text>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:text>no</xsl:text>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="oclc_number">
-      <xsl:choose>
-        <xsl:when test='contains(tmarc:c001,"ocn") or
-                        contains(tmarc:c001,"ocm") or
-                        contains(tmarc:c001,"OCoLC") '>
-         <xsl:value-of select="tmarc:c001"/>
-        </xsl:when>
-        <xsl:when test='contains(tmarc:d035/tmarc:sa,"ocn") or
-                        contains(tmarc:d035/tmarc:sa,"ocm") or
-                        contains(tmarc:d035/tmarc:sa,"OCoLC") '>
-         <xsl:value-of select="tmarc:d035/tmarc:sa"/>
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="date_008">
-      <xsl:choose>
-        <xsl:when test="contains('cestpudikmr', substring(tmarc:c008, 7, 1))">
-          <xsl:value-of select="substring(tmarc:c008, 8, 4)" />
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <xsl:variable name="date_end_008">
-      <xsl:choose>
-        <xsl:when test="contains('dikmr', substring(tmarc:c008, 7, 1))">
-          <xsl:value-of select="substring(tmarc:c008, 12, 4)" />
-        </xsl:when>
-      </xsl:choose>
-    </xsl:variable>
-
-    <pz:record>
-<!--
-      <xsl:attribute name="mergekey">
-    <xsl:text>title </xsl:text>
-  <xsl:value-of select="tmarc:d245/tmarc:sa" />
-  <xsl:text> author </xsl:text>
-  <xsl:value-of select="tmarc:d100/tmarc:sa" />
-  <xsl:text> medium </xsl:text>
-  <xsl:value-of select="$medium" />
-    </xsl:attribute>
-  -->
-
-      <xsl:for-each select="tmarc:c001">
-        <pz:metadata type="id">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:if test="string-length($oclc_number) &gt; 0">
-       <pz:metadata type="oclc-number">
-         <xsl:value-of select="$oclc_number" />
-       </pz:metadata>
-      </xsl:if>
-
-      <xsl:for-each select="tmarc:d010">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="lccn">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d020">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="isbn">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d022">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="issn">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-      
-      <xsl:for-each select="tmarc:d027">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="tech-rep-nr">
-           <xsl:value-of select="tmarc:sa" />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-      
-      <xsl:for-each select="tmarc:d035"> 
-        <pz:metadata type="system-control-nr">
-          <xsl:choose>
-            <xsl:when test="tmarc:sa">
-              <xsl:value-of select="tmarc:sa"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="tmarc:sb"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d100">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="author">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="author-title">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sd">
-         <pz:metadata type="author-date">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d110">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="corporate-name">
-          <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="corporate-location">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sd">
-         <pz:metadata type="corporate-date">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-      
-      <xsl:for-each select="tmarc:d111">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="meeting-name">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="meeting-location">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sd">
-         <pz:metadata type="meeting-date">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d260">
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="date">
-           <xsl:value-of select="translate(., 'cp[].', '')" />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:if test="string-length($date_008) &gt; 0 and not(tmarc:d260)">
-        <pz:metadata type="date">
-          <xsl:choose>
-            <xsl:when test="$date_end_008">
-              <xsl:value-of select="concat($date_008,'-',$date_end_008)" />
-            </xsl:when>
-            <xsl:otherwise> 
-              <xsl:value-of select="$date_008" />
-            </xsl:otherwise>
-          </xsl:choose>
-        </pz:metadata>
-      </xsl:if>
-
-      <xsl:for-each select="tmarc:d130">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="title-uniform">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sm">
-         <pz:metadata type="title-uniform-media">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sn">
-         <pz:metadata type="title-uniform-parts">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sp">
-         <pz:metadata type="title-uniform-partname">
-           <xsl:value-of select="." />     
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sr">
-         <pz:metadata type="title-uniform-key">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-      
-      <xsl:for-each select="tmarc:d245">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="title">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sb">
-         <pz:metadata type="title-remainder">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="title-responsibility">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sf">
-         <pz:metadata type="title-dates">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sh">
-         <pz:metadata type="title-medium">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sn">
-         <pz:metadata type="title-number-section">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:if test="tmarc:sa">
-         <pz:metadata type="title-complete">
-           <xsl:value-of select="tmarc:sa" />
-           <xsl:if test="tmarc:sb" ><xsl:value-of select="concat(' ', tmarc:sb)" /></xsl:if>
-         </pz:metadata>
-       </xsl:if>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d250">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="edition">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d260">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="publication-place">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sb">
-         <pz:metadata type="publication-name">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="publication-date">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d300">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="physical-extent">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sb">
-         <pz:metadata type="physical-format">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sc">
-         <pz:metadata type="physical-dimensions">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:se">
-         <pz:metadata type="physical-accomp">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sf">
-         <pz:metadata type="physical-unittype">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sg">
-         <pz:metadata type="physical-unitsize">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:s3">
-         <pz:metadata type="physical-specified">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d440">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="series-title">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d500">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d505">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d518">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d520">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d522">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d911">
-        <pz:metadata type="description">
-          <xsl:for-each select="node()">
-            <xsl:value-of select="text()" />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d600 | tmarc:d610 | tmarc:d611 | tmarc:d630 |
-                            tmarc:d648 | tmarc:d650 | tmarc:d651 | tmarc:d653 |
-                            tmarc:d654 | tmarc:d655 | tmarc:d656 | tmarc:d657 |
-                            tmarc:d658 | tmarc:d662 | tmarc:d69X">
-       <xsl:for-each select="tmarc:sa">
-         <pz:metadata type="subject">
-           <xsl:value-of select="."/>
-         </pz:metadata>
-       </xsl:for-each>
-       <pz:metadata type="subject-long">
-           <xsl:for-each select="node()/text()">
-             <xsl:if test="position() &gt; 1">
-               <xsl:text>, </xsl:text>
-             </xsl:if>
-            <xsl:variable name='value'>
-              <xsl:value-of select='normalize-space(.)'/>
-            </xsl:variable>
-            <xsl:choose>
-              <xsl:when test="substring($value, string-length($value)) = ','">
-                <xsl:value-of select="substring($value, 1, string-length($value)-1)"/>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="$value"/>
-              </xsl:otherwise>
-            </xsl:choose> 
-          </xsl:for-each>
-         </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d856">
-       <xsl:for-each select="tmarc:su">
-         <pz:metadata type="electronic-url">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-        <pz:metadata type="electronic-text">
-         <xsl:choose>
-           <xsl:when test="tmarc:sy">
-             <xsl:value-of select="tmarc:sy/text()" />
-           </xsl:when>
-           <xsl:when test="tmarc:s3">
-             <xsl:value-of select="tmarc:s3/text()" />
-           </xsl:when>
-           <xsl:when test="tmarc:sa">
-             <xsl:value-of select="tmarc:sa/text()" />
-           </xsl:when>
-           <xsl:otherwise>Get resource</xsl:otherwise>
-         </xsl:choose>
-        </pz:metadata>
-       <xsl:for-each select="tmarc:sz">
-         <pz:metadata type="electronic-note">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:si">
-         <pz:metadata type="electronic-format-instruction">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-       <xsl:for-each select="tmarc:sq">
-         <pz:metadata type="electronic-format-type">
-           <xsl:value-of select="." />
-         </pz:metadata>
-       </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d773">
-        <pz:metadata type="citation">
-          <xsl:for-each select="*">
-            <xsl:value-of select="normalize-space(.)" />
-            <xsl:text> </xsl:text>
-          </xsl:for-each>
-        </pz:metadata>
-        <xsl:for-each select="tmarc:st">
-          <pz:metadata type="journal-title">
-            <xsl:value-of select="."/>
-          </pz:metadata>
-        </xsl:for-each>
-        <xsl:if test="tmarc:sg">
-         <xsl:variable name="value">
-            <xsl:for-each select="tmarc:sg">
-              <xsl:value-of select="."/>
-            </xsl:for-each>
-         </xsl:variable>
-          <pz:metadata type="journal-subpart">
-            <xsl:value-of select="$value"/>
-         </pz:metadata>
-         <xsl:variable name="l">
-           <xsl:value-of select="translate($value,
-                                 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.',
-                                 'abcdefghijklmnopqrstuvwxyz ') "/>
-         </xsl:variable>
-         <xsl:variable name="volume">
-           <xsl:choose>
-             <xsl:when test="string-length(substring-after($l,'vol ')) &gt; 0">
-               <xsl:value-of select="substring-before(normalize-space(substring-after($l,'vol ')),' ')"/>
-             </xsl:when>
-             <xsl:when test="string-length(substring-after($l,'v ')) &gt; 0">
-               <xsl:value-of select="substring-before(normalize-space(substring-after($l,'v ')),' ')"/>
-             </xsl:when>
-           </xsl:choose>
-         </xsl:variable>
-         <xsl:variable name="issue">
-           <xsl:value-of select="substring-before(translate(normalize-space(substring-after($l,'issue')), ',', ' '),' ')"/>
-         </xsl:variable>
-         <xsl:variable name="pages">
-           <xsl:choose>
-             <xsl:when test="string-length(substring-after($l,' p ')) &gt; 0">
-               <xsl:value-of select="normalize-space(substring-after($l,' p '))"/>
-             </xsl:when>
-             <xsl:when test="string-length(substring-after($l,',p')) &gt; 0">
-               <xsl:value-of select="normalize-space(substring-after($l,',p'))"/>
-             </xsl:when>
-             <xsl:when test="string-length(substring-after($l,' p')) &gt; 0">
-               <xsl:value-of select="normalize-space(substring-after($l,' p'))"/>
-             </xsl:when>
-           </xsl:choose>
-         </xsl:variable>
-
-         <!-- volume -->
-         <xsl:if test="string-length($volume) &gt; 0">
-           <pz:metadata type="volume-number">
-             <xsl:value-of select="$volume"/>
-           </pz:metadata>
-         </xsl:if>
-         <!-- issue -->
-         <xsl:if test="string-length($issue) &gt; 0">
-           <pz:metadata type="issue-number">
-             <xsl:value-of select="$issue"/>
-           </pz:metadata>
-         </xsl:if>
-         <!-- pages -->
-         <xsl:if test="string-length($pages) &gt; 0">
-           <pz:metadata type="pages-number">
-             <xsl:value-of select="$pages"/>
-           </pz:metadata>
-         </xsl:if>
-
-         <!-- season -->
-        </xsl:if>
-        <xsl:if test="tmarc:sp">
-          <pz:metadata type="journal-title-abbrev">
-            <xsl:value-of select="tmarc:sp"/>
-          </pz:metadata>
-        </xsl:if>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d852">
-        <xsl:for-each select="tmarc:sy">
-          <pz:metadata type="publicnote">
-            <xsl:value-of select="." />
-          </pz:metadata>
-        </xsl:for-each>
-        <xsl:for-each select="tmarc:sh">
-          <pz:metadata type="callnumber">
-            <xsl:value-of select="." />
-          </pz:metadata>
-        </xsl:for-each>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d876">
-        <xsl:if test="tmarc:sf">
-          <pz:metadata type="loan-period">
-            <xsl:value-of select="concat(tmarc:s5,':',tmarc:sf)" />
-          </pz:metadata>
-        </xsl:if>
-      </xsl:for-each>
-
-      <pz:metadata type="medium">
-        <xsl:value-of select="$vmedium" />
-       <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
-         <xsl:text> (electronic)</xsl:text>
-       </xsl:if>
-      </pz:metadata>
-
-      <xsl:for-each select="tmarc:d900/tmarc:sa">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <!-- <xsl:if test="$fulltext_a"> <pz:metadata type="fulltext"> <xsl:value-of 
-        select="$fulltext_a"/> </pz:metadata> </xsl:if> -->
-
-      <xsl:for-each select="tmarc:d900/tmarc:sb">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:se">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:sf">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:si">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:sk">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:sq">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:ss">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:su">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d900/tmarc:sy">
-        <pz:metadata type="fulltext">
-          <xsl:value-of select="." />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d903">
-        <xsl:if test="tmarc:sa">
-          <pz:metadata type="publication-date">
-            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
-          </pz:metadata>
-          <pz:metadata type="date">
-            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
-          </pz:metadata>
-        </xsl:if>
-      </xsl:for-each>
-
-      <!-- <xsl:if test="$fulltext_b"> <pz:metadata type="fulltext"> <xsl:value-of 
-        select="$fulltext_b"/> </pz:metadata> </xsl:if> -->
-
-      <pz:metadata type="has-fulltext">
-        <xsl:value-of select="$has_fulltext"/>
-      </pz:metadata>
-
-      <xsl:for-each select="tmarc:d907 | tmarc:d901">
-        <pz:metadata type="iii-id">
-          <xsl:value-of select="tmarc:sa" />
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d926">
-        <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:sa"/>
-       </pz:metadata>
-        <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:sc"/>
-       </pz:metadata>
-        <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:se"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <!-- OhioLINK holdings -->
-      <xsl:for-each select="tmarc:d945">
-       <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:sa"/>
-       </pz:metadata>
-       <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:sb"/>
-       </pz:metadata>
-       <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
-         <xsl:value-of select="tmarc:sc"/>
-       </pz:metadata>
-       <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
-          <xsl:choose>
-            <xsl:when test="tmarc:ss = 'N'">Available</xsl:when>
-            <xsl:otherwise>
-             <xsl:value-of select="tmarc:sd"/>
-           </xsl:otherwise>
-         </xsl:choose>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d948">
-        <pz:metadata type="holding">
-          <xsl:for-each select="tmarc:s">
-            <xsl:if test="position() > 1">
-              <xsl:text> </xsl:text>
-            </xsl:if>
-            <xsl:value-of select="." />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d991">
-        <pz:metadata type="holding">
-          <xsl:for-each select="tmarc:s">
-            <xsl:if test="position() > 1">
-              <xsl:text> </xsl:text>
-            </xsl:if>
-            <xsl:value-of select="." />
-          </xsl:for-each>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="tmarc:d999">
-        <pz:metadata type="localid">
-          <xsl:choose>
-            <xsl:when test="tmarc:sa">
-              <xsl:value-of select="tmarc:sa"/>
-            </xsl:when>
-            <xsl:when test="tmarc:sc">
-              <xsl:value-of select="tmarc:sc"/>
-            </xsl:when> 
-            <xsl:otherwise>
-              <xsl:value-of select="tmarc:sd"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </pz:metadata>
-      </xsl:for-each>
-
-
-      <!-- passthrough id data -->
-      <xsl:for-each select="pz:metadata">
-        <xsl:copy-of select="." />
-      </xsl:for-each>
-
-      <!-- other stylesheets importing this might want to define this -->
-       <xsl:call-template name="record-hook" />
-
-    </pz:record>
-  </xsl:template>
-
-  <xsl:template match="text()" />
-
-</xsl:stylesheet>
diff --git a/etc/unimarc.xsl b/etc/unimarc.xsl
deleted file mode 100644 (file)
index 4842e24..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-
- <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-
-  <xsl:template match="/marc:record">
-    <pz:record>
-
-      <xsl:for-each select="marc:controlfield[@tag='001']">
-        <pz:metadata type="id">
-          <xsl:value-of select="."/>
-        </pz:metadata>
-      </xsl:for-each>
-
-      <!-- -->
-      <xsl:for-each select="marc:datafield[@tag='020']">
-       <xsl:if test="marc:subfield[@code='a'] = 'US'">
-          <pz:metadata type="lccn">
-           <xsl:value-of select="marc:subfield[@code='b']"/>
-         </pz:metadata>
-       </xsl:if>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='010']">
-        <pz:metadata type="isbn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag='011']">
-        <pz:metadata type="issn">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-
-      <xsl:for-each select="marc:datafield[@tag='200']">
-        <pz:metadata type="title">
-          <xsl:value-of select="marc:subfield[@code='a']"/>
-        </pz:metadata>
-      </xsl:for-each>
-
-
-      <!-- Date of Pulbication -->
-      <xsl:for-each select="marc:datafield[@tag='210']">
-        <pz:metadata type="date">
-         <xsl:value-of select="marc:subfield[@code='d']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <!--  Usmarc 650 maps to unimarc 606 and marc21 653 maps to unimarc 610 -->
-      <xsl:for-each select="marc:datafield[@tag='606' or @tag='610']">
-       <pz:metadata type="subject">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <xsl:for-each select="marc:datafield[@tag &gt;= 300 and @tag &lt;= 345]
-                            [@tag != '325']">
-        <pz:metadata type="description">
-            <xsl:value-of select="*/text()"/>
-        </pz:metadata>
-      </xsl:for-each>
-
-
-      <!-- Author : primary, alternative and secondary responsibility (equivalent marc21 tags : 100, 700 -->
-      <xsl:for-each select="marc:datafield[@tag='700' or @tag='701' or @tag='702']">
-       <pz:metadata type="author">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-          <xsl:text>, </xsl:text>
-         <xsl:value-of select="marc:subfield[@code='b']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-      <!-- Author : marc21 tag 720 maps to unimarc 730
-      <xsl:for-each select="marc:datafield[@tag='730']">
-       <pz:metadata type="author">
-         <xsl:value-of select="marc:subfield[@code='a']"/>
-       </pz:metadata>
-      </xsl:for-each>
-      -->
-
-      <!-- -->
-      <xsl:for-each select="marc:datafield[@tag='856']">
-       <pz:metadata type="url">
-         <xsl:value-of select="marc:subfield[@code='u']"/>
-       </pz:metadata>
-      </xsl:for-each>
-
-    </pz:record>
-  </xsl:template>
-
-</xsl:stylesheet>
diff --git a/etc/usmarc.xsl b/etc/usmarc.xsl
deleted file mode 100644 (file)
index 12346c8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
-    version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
-    xmlns:marc="http://www.loc.gov/MARC21/slim">
-  
-  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
-
-  <xsl:include href="marc21.xsl"/>
-
-</xsl:stylesheet>
diff --git a/etc/xsl/MarcXML2TurboMarc.xsl b/etc/xsl/MarcXML2TurboMarc.xsl
new file mode 100644 (file)
index 0000000..566fe03
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Converts MarcXML to TurboMarc
+    (to benefit from pazpar2's improved tmarc.xsl)
+
+    Also includes a provision to handle PicaMarc where datafield names can
+    contain a @ that is changed to Ä to give valid XML.
+    2010-2011
+    Sven-S. Porst, SUB Göttingen <porst@sub.uni-goettingen.de>
+-->
+<xsl:stylesheet
+   version="1.0"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   xmlns:tmarc="http://www.indexdata.com/turbomarc"
+   xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<xsl:template match="@*|node()">
+  <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+</xsl:template>
+
+
+<xsl:template match="record|marc:record">
+  <xsl:element name="r" namespace="http://www.indexdata.com/turbomarc">
+    <xsl:apply-templates select="@*|node()"/>
+    </xsl:element>
+</xsl:template>
+
+
+<xsl:template match="leader|marc:leader">
+  <xsl:element name="l" namespace="http://www.indexdata.com/turbomarc">
+    <xsl:apply-templates select="@*|node()"/>
+    </xsl:element>
+</xsl:template>
+
+
+<xsl:template match="controlfield|datafield|subfield|marc:controlfield|marc:datafield|marc:subfield">
+  <!--
+      Try to mock Indexdata's specification without regexps:
+      Translate all allowed characters to 'a' and assume field names are
+      shorter than 62 characters.
+      Given the typical 3 digit Marc field numbers this seems
+      safe in the practical cases I have seen.
+
+      http://www.indexdata.com/blog/2010/05/turbomarc-faster-xml-marc-records
+      http://www.indexdata.com/yaz/doc/marc.html
+      -->
+
+  <xsl:variable name="allowedCharacters" select="'0123465789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@'"/>
+  <xsl:variable name="manyAs" select="'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'"/>
+
+  <xsl:choose>
+    <xsl:when test="(name(.)='datafield' or name(.)='controlfield') and
+                   contains($manyAs, translate(@tag, $allowedCharacters, $manyAs))">
+      <xsl:element name="{concat(substring(local-name(),1,1), translate(@tag,'@','Ä'))}"
+                  namespace="http://www.indexdata.com/turbomarc">
+       <xsl:apply-templates select="@*[name(.)!='tag']|node()"/>
+       </xsl:element>
+      </xsl:when>
+
+    <xsl:when test="name(.)='subfield' and
+                   contains($manyAs, translate(@code, $allowedCharacters, $manyAs))">
+      <xsl:element name="{concat(substring(local-name(),1,1), @code)}"
+                  namespace="http://www.indexdata.com/turbomarc">
+       <xsl:apply-templates select="@*[name(.)!='code']|node()"/>
+       </xsl:element>
+      </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:copy>
+       <xsl:apply-templates select="@*|node()"/>
+       </xsl:copy>
+      </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/etc/xsl/cf.xsl b/etc/xsl/cf.xsl
new file mode 100644 (file)
index 0000000..7796273
--- /dev/null
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This stylesheet expects Connector Frameworks records
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:siebel="http://loc.gov/siebel/elements/1.0/" >
+
+ <xsl:output indent="yes"
+        method="xml"
+        version="1.0"
+        encoding="UTF-8"/>
+
+  <xsl:param name="medium" />
+
+  <!--
+    According to cf/builder/templates/parseTask.cff, connectors can
+    also generate a "medium" field, but that is ignored in this
+    stylesheet, the rule below instead using an XSLT parameter.
+    Should the data element be used in preference when it is included?
+  -->
+
+  <xsl:template match="/record">
+    <pz:record>
+      <pz:metadata type="medium">
+        <xsl:choose>
+          <xsl:when test="string-length($medium)">
+            <xsl:value-of select="$medium" />
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:if test="medium">
+             <xsl:value-of select="medium" />
+            </xsl:if>
+          </xsl:otherwise>
+        </xsl:choose>
+      </pz:metadata>
+      <xsl:apply-templates/>
+    </pz:record>
+  </xsl:template>
+
+  <!--
+      The elements mapped in the following clauses should be kept more
+      or less in sync with those named in builder/templates/search.cft
+      in the "cf" git module.
+  -->
+
+  <xsl:template match="date">
+    <pz:metadata type="publication-date">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+    <pz:metadata type="date">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="url">
+    <pz:metadata type="electronic-url">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="title">
+    <pz:metadata type="title">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+    <pz:metadata type="title-complete">
+      <xsl:value-of select="." />
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="journaltitle">
+    <pz:metadata type="journal-title">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <!--
+    According to cf/builder/templates/parseTask.cff, connectors can
+    also generate a "holding" field, but it's not clear how that is
+    different from "item".  Perhaps this "item" rule should also
+    handle "holding" in the same way?
+  -->
+
+  <xsl:template match="item">
+    <pz:metadata type="due" empty="PAZPAR2_NULL_VALUE">
+      <xsl:value-of select="due"/>
+    </pz:metadata>
+    <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
+      <xsl:value-of select="location"/>
+    </pz:metadata>
+    <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
+      <xsl:value-of select="callno"/>
+    </pz:metadata>
+    <pz:metadata type="available" empty="PAZPAR_NULL_VALUE">
+      <xsl:value-of select="available"/>
+    </pz:metadata>
+    <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
+      <xsl:value-of select="publicnote"/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="location">
+    <pz:metadata type="locallocation">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="callno">
+    <pz:metadata type="callnumber">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+  
+  <!-- no-op template to avoid printing medium out --> 
+  <xsl:template match="medium" />
+
+  <xsl:template match="*" >
+    <pz:metadata type="{local-name()}">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/danmarc2.xsl b/etc/xsl/danmarc2.xsl
new file mode 100644 (file)
index 0000000..7e595b1
--- /dev/null
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Beginnings of Danmarc2 XSL.
+
+   This is just USMARC with minor tweaks.. Not complete!
+-->
+  <xsl:include href="pz2-ourl-marc21.xsl" />
+
+  <xsl:template match="/marc:record">
+    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
+    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
+    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
+    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
+    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
+    <xsl:variable name="medium">
+      <xsl:choose>
+       <xsl:when test="$title_medium">
+         <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
+       </xsl:when>
+       <xsl:when test="$fulltext_a">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$fulltext_b">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$electronic_location_url">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$journal_title">
+         <xsl:text>article</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:text>book</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+      <xsl:attribute name="mergekey">
+        <xsl:text>title </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
+       <xsl:text> author </xsl:text>
+       <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
+       <xsl:text> medium </xsl:text>
+       <xsl:value-of select="$medium"/>
+      </xsl:attribute>
+
+
+      <xsl:for-each select="marc:datafield[@tag='001']/marc:subfield[@code='a']">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='010']">
+        <pz:metadata type="lccn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='020']">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='022']">
+        <pz:metadata type="issn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='027']">
+        <pz:metadata type="tech-rep-nr">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='100']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="author-title">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="author-date">
+         <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='110']">
+       <pz:metadata type="corporate-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='111']">
+       <pz:metadata type="meeting-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+       <pz:metadata type="date">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='245']">
+        <pz:metadata type="title">
+          <xsl:value-of select="marc:subfield[@code='a']"/>
+        </pz:metadata>
+        <pz:metadata type="title-remainder">
+          <xsl:value-of select="marc:subfield[@code='b']"/>
+        </pz:metadata>
+        <pz:metadata type="title-responsibility">
+          <xsl:value-of select="marc:subfield[@code='c']"/>
+        </pz:metadata>
+        <pz:metadata type="title-dates">
+          <xsl:value-of select="marc:subfield[@code='f']"/>
+        </pz:metadata>
+        <pz:metadata type="title-medium">
+          <xsl:value-of select="marc:subfield[@code='h']"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='250']">
+       <pz:metadata type="edition">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+        <pz:metadata type="publication-place">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-name">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-date">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='300']">
+       <pz:metadata type="physical-extent">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-format">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-dimensions">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-accomp">
+         <xsl:value-of select="marc:subfield[@code='e']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unittype">
+         <xsl:value-of select="marc:subfield[@code='f']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unitsize">
+         <xsl:value-of select="marc:subfield[@code='g']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-specified">
+         <xsl:value-of select="marc:subfield[@code='3']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='440']">
+       <pz:metadata type="series-title">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag &gt;= 500 and @tag &lt;= 599]
+                           [@tag != '506' and @tag != '530' and
+                           @tag != '540' and @tag != '546'
+                            and @tag != '522']">
+       <pz:metadata type="description">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='650' or @tag='653'
+          or @tag='630' or @tag='666']">
+
+         <xsl:for-each select="marc:subfield">
+               <pz:metadata type="subject">
+                       <xsl:value-of select="."/>
+               </pz:metadata>
+         </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='856']">
+       <pz:metadata type="electronic-url">
+         <xsl:value-of select="marc:subfield[@code='u']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-text">
+         <xsl:value-of select="marc:subfield[@code='y']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-note">
+         <xsl:value-of select="marc:subfield[@code='z']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='773']">
+       <pz:metadata type="citation">
+         <xsl:for-each select="*">
+           <xsl:value-of select="normalize-space(.)"/>
+           <xsl:text> </xsl:text>
+         </xsl:for-each>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+       <xsl:value-of select="$medium"/>
+      </pz:metadata>
+
+      <xsl:if test="$fulltext_a">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_a"/>
+       </pz:metadata>
+      </xsl:if>
+
+      <xsl:if test="$fulltext_b">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_b"/>
+       </pz:metadata>
+      </xsl:if>
+
+      <xsl:if test="$open_url_resolver">
+        <pz:metadata type="open-url">
+            <xsl:call-template name="insert-md-openurl" />
+        </pz:metadata>
+      </xsl:if>
+
+    </pz:record>
+
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/dc.xsl b/etc/xsl/dc.xsl
new file mode 100644 (file)
index 0000000..d9ae36d
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    This stylesheet expects oai/dc records
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/">
+
+ <xsl:output indent="yes"
+        method="xml"
+        version="1.0"
+        encoding="UTF-8"/>
+
+  <xsl:param name="medium" />
+
+  <xsl:template match="/*">
+    <pz:record>
+
+      <pz:metadata type="id">
+        <xsl:value-of select="dc:identifier"/>
+      </pz:metadata>
+
+      <xsl:for-each select="dc:title">
+        <pz:metadata type="title">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:date">
+        <pz:metadata type="date">
+         <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:subject">
+        <pz:metadata type="subject">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:creator">
+             <pz:metadata type="author">
+          <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:description">
+        <pz:metadata type="description">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:identifier">
+        <pz:metadata type="electronic-url">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:type">
+        <pz:metadata type="medium">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dcterms:bibliographicCitation">
+        <pz:metadata type="citation">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+        <xsl:value-of select="$medium" />
+      </pz:metadata>
+
+    </pz:record>
+  </xsl:template>
+
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/dkabm.xsl b/etc/xsl/dkabm.xsl
new file mode 100644 (file)
index 0000000..ca135b6
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This stylesheet expects dkabm collection records as returned
+    from DBC's OpenSearch service.
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/"
+    xmlns:dkabm="http://biblstandard.dk/abm/namespace/dkabm/"
+    xmlns:os="http://oss.dbc.dk/ns/opensearch">
+
+ <xsl:output indent="yes"
+        method="xml"
+        version="1.0"
+        encoding="UTF-8"/>
+
+  <xsl:param name="medium" />
+
+  <xsl:template match="/">
+    <pz:cluster>
+      <xsl:apply-templates/>
+    </pz:cluster>
+  </xsl:template>
+
+  <xsl:template match="os:object">
+    <pz:record>
+      <xsl:apply-templates/>
+    </pz:record>
+  </xsl:template>
+
+  <xsl:template match="os:score">
+    <pz:metadata type="score">
+      <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="dkabm:record">
+
+      <pz:metadata type="id">
+        <xsl:value-of select="dc:identifier"/>
+      </pz:metadata>
+
+      <xsl:for-each select="dc:title">
+        <pz:metadata type="title">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:date">
+        <pz:metadata type="date">
+         <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:subject">
+        <pz:metadata type="subject">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:creator">
+             <pz:metadata type="author">
+          <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:description">
+        <pz:metadata type="description">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:identifier">
+        <pz:metadata type="electronic-url">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:type">
+        <pz:metadata type="medium">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dcterms:bibliographicCitation">
+        <pz:metadata type="citation">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+        <xsl:value-of select="$medium" />
+      </pz:metadata>
+
+  </xsl:template>
+
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/marc21-ourl.xsl b/etc/xsl/marc21-ourl.xsl
new file mode 100644 (file)
index 0000000..804c153
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+  
+  <xsl:import href="marc21.xsl" />
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+  <xsl:include href="pz2-ourl-marc21.xsl" />
+
+  <xsl:template name="record-hook">
+   Our hook
+      <xsl:if test="$open_url_resolver">
+        <pz:metadata type="open-url">
+            <xsl:call-template name="insert-md-openurl" />
+        </pz:metadata>
+      </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/marc21.xsl b/etc/xsl/marc21.xsl
new file mode 100644 (file)
index 0000000..e7bee0c
--- /dev/null
@@ -0,0 +1,467 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+  
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Extract metadata from MARC21/USMARC 
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+  <xsl:template name="record-hook"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="marc:collection">
+    <pz:collection>
+        <xsl:apply-templates/>
+    </pz:collection>
+  </xsl:template>
+
+  <xsl:template match="marc:record">
+    <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
+    <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
+    <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
+    <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
+    <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
+    <xsl:variable name="medium">
+      <xsl:choose>
+       <xsl:when test="$title_medium">
+         <xsl:value-of select="translate($title_medium, ' []/', '')"/>
+       </xsl:when>
+       <xsl:when test="$fulltext_a">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$fulltext_b">
+         <xsl:text>electronic resource</xsl:text>
+       </xsl:when>
+       <xsl:when test="$journal_title">
+         <xsl:text>article</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:text>book</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="has_fulltext">
+      <xsl:choose>
+        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='q']">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='i']='TEXT*'">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>no</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="oclc_number">
+      <xsl:variable name="c001" select='marc:controlfield[@tag="001"]' />
+      <xsl:choose>
+        <xsl:when test='contains(marc:controlfield[@tag="001"],"ocn") or
+                        contains(marc:controlfield[@tag="001"],"ocm") or
+                        contains(marc:controlfield[@tag="001"],"OCoLC")'>
+            <xsl:value-of select="marc:controlfield[@tag='001']"/>
+        </xsl:when>
+        <xsl:when test='contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"ocn") or
+                        contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"ocm") or
+                        contains(marc:datafield[@tag="035"]/marc:subfield[@code="a"],"OCoLC") '>
+         <xsl:value-of select="marc:datafield[@tag='035']/marc:subfield[@code='a']"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="date_008">
+      <xsl:choose>
+        <xsl:when test="contains('cestpudikmr', substring(marc:controlfield[@tag='008'], 7, 1))">
+          <xsl:value-of select="substring(marc:controlfield[@tag='008'], 8, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="date_end_008">
+      <xsl:choose>
+        <xsl:when test="contains('dikmr', substring(marc:controlfield[@tag='008'], 7, 1))">
+          <xsl:value-of select="substring(marc:controlfield[@tag='008'], 12, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+      <xsl:for-each select="marc:controlfield[@tag='001']">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="oclc-number">
+        <xsl:value-of select="$oclc_number" />
+      </pz:metadata>
+
+      <xsl:for-each select="marc:datafield[@tag='010']">
+        <pz:metadata type="lccn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='020']">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='022']">
+        <pz:metadata type="issn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='027']">
+        <pz:metadata type="tech-rep-nr">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='035']">
+        <pz:metadata type="system-control-nr">
+          <xsl:choose>
+            <xsl:when test="marc:subfield[@code='a']">
+              <xsl:value-of select="marc:subfield[@code='a']"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="marc:subfield[@code='b']"/>
+            </xsl:otherwise>
+          </xsl:choose>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='100']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="author-title">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="author-date">
+         <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='110']">
+       <pz:metadata type="corporate-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="corporate-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='111']">
+       <pz:metadata type="meeting-name">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-location">
+           <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="meeting-date">
+           <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='130']">
+        <pz:metadata type="title-uniform">
+          <xsl:value-of select="marc:subfield[@code='a']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-media">
+          <xsl:value-of select="marc:subfield[@code='m']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-parts">
+          <xsl:value-of select="marc:subfield[@code='n']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-partname">
+          <xsl:value-of select="marc:subfield[@code='p']" />
+        </pz:metadata>
+        <pz:metadata type="title-uniform-key">
+          <xsl:value-of select="marc:subfield[@code='r']" />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+        <pz:metadata type="date">
+          <xsl:value-of select="translate(marc:subfield[@code='c'], 'cp[].', '')" />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:if test="$date_008 and not(marc:datafield[@tag='260'])">
+        <pz:metadata type="date">
+          <xsl:choose>
+            <xsl:when test="$date_end_008">
+              <xsl:value-of select="concat($date_008,'-',$date_end_008)" />
+            </xsl:when>
+            <xsl:otherwise> 
+              <xsl:value-of select="$date_008" />
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:if>
+
+      <xsl:for-each select="marc:datafield[@tag='245']">
+        <pz:metadata type="title">
+          <xsl:value-of select="marc:subfield[@code='a']"/>
+        </pz:metadata>
+        <pz:metadata type="title-remainder">
+          <xsl:value-of select="marc:subfield[@code='b']"/>
+        </pz:metadata>
+        <pz:metadata type="title-responsibility">
+          <xsl:value-of select="marc:subfield[@code='c']"/>
+        </pz:metadata>
+        <pz:metadata type="title-dates">
+          <xsl:value-of select="marc:subfield[@code='f']"/>
+        </pz:metadata>
+        <pz:metadata type="title-medium">
+          <xsl:value-of select="marc:subfield[@code='h']"/>
+        </pz:metadata>
+        <pz:metadata type="title-number-section">
+          <xsl:value-of select="marc:subfield[@code='n']"/>
+        </pz:metadata>
+        <pz:metadata type="title-complete">
+          <xsl:value-of select="marc:subfield[@code='a']" />
+          <xsl:if test="marc:subfield[@code='b']" ><xsl:value-of select="concat(' ', marc:subfield[@code='b'])" /></xsl:if>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='250']">
+       <pz:metadata type="edition">
+           <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='260']">
+        <pz:metadata type="publication-place">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-name">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+        <pz:metadata type="publication-date">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='300']">
+       <pz:metadata type="physical-extent">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-format">
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-dimensions">
+         <xsl:value-of select="marc:subfield[@code='c']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-accomp">
+         <xsl:value-of select="marc:subfield[@code='e']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unittype">
+         <xsl:value-of select="marc:subfield[@code='f']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-unitsize">
+         <xsl:value-of select="marc:subfield[@code='g']"/>
+       </pz:metadata>
+       <pz:metadata type="physical-specified">
+         <xsl:value-of select="marc:subfield[@code='3']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='440']">
+       <pz:metadata type="series-title">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag = '500' or @tag = '505' or
+               @tag = '518' or @tag = '520' or @tag = '522']">
+       <pz:metadata type="description">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+       <xsl:for-each
+               select="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
+               <pz:metadata type="subject">
+                       <xsl:value-of select="marc:subfield[@code='a']" />
+               </pz:metadata>
+               <pz:metadata type="subject-long">
+                       <xsl:for-each select="node()/text()">
+                               <xsl:if test="position() > 1">
+                                       <xsl:text>, </xsl:text>
+                               </xsl:if>
+                               <xsl:variable name='value'>
+                                       <xsl:value-of select='normalize-space(.)' />
+                               </xsl:variable>
+                               <xsl:choose>
+                                       <xsl:when test="substring($value,string-length($value)) = ','">
+                                               <xsl:value-of select="substring($value,1,string-length($value)-1)" />
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <xsl:value-of select="$value" />
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                       </xsl:for-each>
+               </pz:metadata>
+       </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='856']">
+       <pz:metadata type="electronic-url">
+         <xsl:value-of select="marc:subfield[@code='u']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-text">
+         <xsl:value-of select="marc:subfield[@code='y' or @code='3' or @code='a']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-note">
+         <xsl:value-of select="marc:subfield[@code='z']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-format-instruction">
+         <xsl:value-of select="marc:subfield[@code='i']"/>
+       </pz:metadata>
+       <pz:metadata type="electronic-format-type">
+         <xsl:value-of select="marc:subfield[@code='q']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='773']">
+       <pz:metadata type="citation">
+             <xsl:for-each select="*">
+               <xsl:value-of select="normalize-space(.)"/>
+               <xsl:text> </xsl:text>
+         </xsl:for-each>
+        </pz:metadata>
+        <xsl:if test="marc:subfield[@code='t']">
+         <pz:metadata type="journal-title">
+               <xsl:value-of select="marc:subfield[@code='t']"/>
+          </pz:metadata>          
+        </xsl:if>
+        <xsl:if test="marc:subfield[@code='g']">
+         <pz:metadata type="journal-subpart">
+               <xsl:value-of select="marc:subfield[@code='g']"/>
+          </pz:metadata>          
+        </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='852']">
+        <xsl:if test="marc:subfield[@code='y']">
+         <pz:metadata type="publicnote">
+           <xsl:value-of select="marc:subfield[@code='y']"/>
+         </pz:metadata>
+       </xsl:if>
+       <xsl:if test="marc:subfield[@code='h']">
+         <pz:metadata type="callnumber">
+           <xsl:value-of select="marc:subfield[@code='h']"/>
+         </pz:metadata>
+       </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='a']">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+        <xsl:value-of select="$medium"/>
+      </pz:metadata>
+
+      <pz:metadata type="has-fulltext">
+        <xsl:value-of select="$has_fulltext"/> 
+      </pz:metadata>
+
+      <xsl:for-each select="marc:datafield[@tag='900']/marc:subfield[@code='b']">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_b">
+       <pz:metadata type="fulltext">
+         <xsl:value-of select="$fulltext_b"/>
+       </pz:metadata>
+      </xsl:if> -->
+
+      <xsl:for-each select="marc:datafield[@tag='907' or @tag='901']">
+        <pz:metadata type="iii-id">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='926']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='948']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='991']">
+        <pz:metadata type="holding">
+         <xsl:for-each select="marc:subfield">
+           <xsl:if test="position() > 1">
+             <xsl:text> </xsl:text>
+           </xsl:if>
+           <xsl:value-of select="."/>
+         </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='999']">
+        <pz:metadata type="localid">
+          <xsl:choose>
+            <xsl:when test="marc:subfield[@code='a']">
+              <xsl:value-of select="marc:subfield[@code='a']"/>
+            </xsl:when>
+            <xsl:when test="marc:subfield[@code='c']">
+              <xsl:value-of select="marc:subfield[@code='c']"/>
+            </xsl:when> 
+            <xsl:otherwise>
+              <xsl:value-of select="marc:subfield[@code='d']"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- passthrough id data -->
+      <xsl:for-each select="pz:metadata">
+          <xsl:copy-of select="."/>
+      </xsl:for-each>
+
+      <!-- other stylesheets importing this might want to define this -->
+      <xsl:call-template name="record-hook"/>
+
+    </pz:record>    
+  </xsl:template>
+  
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/oai_dc.xsl b/etc/xsl/oai_dc.xsl
new file mode 100644 (file)
index 0000000..36757cc
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    This stylesheet expects oai/dc records
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:oai="http://www.openarchives.org/OAI/2.0/"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/">
+
+ <xsl:output indent="yes"
+        method="xml"
+        version="1.0"
+        encoding="UTF-8"/>
+
+
+
+  <xsl:template match="/oai:record/oai:metadata/*">
+    <pz:record>
+
+      <pz:metadata type="id">
+        <xsl:value-of select="/oai:record/oai:header/oai:identifier"/>
+      </pz:metadata>
+
+      <xsl:for-each select="dc:title">
+        <pz:metadata type="title">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:date">
+        <pz:metadata type="date">
+         <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:subject">
+        <pz:metadata type="subject">
+         <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:creator">
+       <pz:metadata type="author">
+          <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:description">
+        <pz:metadata type="description">
+         <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:identifier">
+        <pz:metadata type="electronic-url">
+         <xsl:value-of select="."/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:type">
+        <pz:metadata type="medium">
+             <xsl:value-of select="."/>
+           </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dcterms:bibliographicCitation">
+        <pz:metadata type="citation">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+    </pz:record>
+  </xsl:template>
+
+
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/opac.xsl b/etc/xsl/opac.xsl
new file mode 100644 (file)
index 0000000..dd5c789
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+  
+  <xsl:import href="marc21.xsl"/>
+
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Extract metadata from OPAC records with embedded MAR records
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+
+  <xsl:template name="record-hook">
+    <xsl:for-each select="/opacRecord/holdings/holding">
+      <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="localLocation"/>
+      </pz:metadata>
+      <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="callNumber"/>
+      </pz:metadata>
+      <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="publicNote"/>
+      </pz:metadata>
+      <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
+        <xsl:choose>
+          <xsl:when test="circulations/circulation/availableNow/@value = '1'">
+             Available
+          </xsl:when>
+          <xsl:when test="circulations/circulation/availableNow/@value = '0'">
+           <xsl:value-of select="circulations/circulation/availabiltyDate"/>
+         </xsl:when>
+        </xsl:choose>
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="/">
+    <xsl:choose>
+      <xsl:when test="opacRecord">
+        <xsl:apply-templates select="opacRecord/bibliographicRecord"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/opac_turbomarc.xsl b/etc/xsl/opac_turbomarc.xsl
new file mode 100644 (file)
index 0000000..98f33b7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.indexdata.com/turbomarc">
+  
+  <xsl:import href="tmarc.xsl"/>
+
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+<!-- Extract metadata from OPAC records with embedded MAR records
+      http://www.loc.gov/marc/bibliographic/ecbdhome.html
+-->  
+
+  <xsl:template name="record-hook">
+    <xsl:for-each select="/opacRecord/holdings/holding">
+      <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="localLocation"/>
+      </pz:metadata>
+      <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="callNumber"/>
+      </pz:metadata>
+      <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
+       <xsl:value-of select="publicNote"/>
+      </pz:metadata>
+      <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
+        <xsl:choose>
+          <xsl:when test="circulations/circulation/availableNow/@value = '1'">
+             Available
+          </xsl:when>
+          <xsl:when test="circulations/circulation/availableNow/@value = '0'">
+           <xsl:value-of select="circulations/circulation/availabiltyDate"/>
+         </xsl:when>
+        </xsl:choose>
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+  <xsl:template match="/">
+    <xsl:choose>
+      <xsl:when test="opacRecord">
+        <xsl:apply-templates select="opacRecord/bibliographicRecord"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/pp2out-to-carrot2.xsl b/etc/xsl/pp2out-to-carrot2.xsl
new file mode 100644 (file)
index 0000000..5bdd7a0
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+<xsl:template match="/">
+  <searchresult>
+    <!-- TODO make query an xsl parameter -->
+    <query>water</query>
+    <xsl:for-each select="show/hit">
+    <document>
+      <xsl:attribute name="id">
+        <xsl:value-of select="recid" />
+      </xsl:attribute>
+      <title><xsl:value-of select="md-title" /></title>
+      <url><xsl:value-of select="location/md-electronic-url" /></url>
+      <snippet xml:space="preserve">
+        <xsl:for-each select="md-description">
+          <xsl:value-of select="." />
+        </xsl:for-each>
+        <xsl:value-of select="md-title-responsibility" />
+      </snippet>
+    </document> 
+    </xsl:for-each>
+  </searchresult>
+</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/etc/xsl/primo-pz2.xsl b/etc/xsl/primo-pz2.xsl
new file mode 100644 (file)
index 0000000..43a92a1
--- /dev/null
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+  xmlns:tmarc="http://www.indexdata.com/turbomarc"
+  xmlns:prim="http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib" 
+  xmlns:sear="http://www.exlibrisgroup.com/xsd/jaguar/search"
+>
+
+  <xsl:output indent="yes" method="xml" version="1.0"
+    encoding="UTF-8" />
+
+  <xsl:template name="record-hook" />
+
+  <xsl:variable name="type" select="/opt/prim:PrimoNMBib/prim:display/prim:type"/>
+  <xsl:variable name="is_article" select="$type = 'article'" />
+  <xsl:variable name="fulltext" select="/opt/prim:PrimoNMBib/prim:delivery/prim:fulltext"/>
+  <xsl:variable name="has_fulltext">
+    <xsl:choose>
+      <xsl:when test="$fulltext = 'no_fulltext' ">
+        <xsl:text>no</xsl:text>
+      </xsl:when>
+      <xsl:when test="$fulltext = 'fulltext'">
+        <xsl:text>yes</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>no</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:template match="/">
+    <xsl:apply-templates />
+  </xsl:template>
+
+  <xsl:template match="sear:RESULT">
+    <pz:records>
+      <xsl:apply-templates />
+    </pz:records>
+  </xsl:template>
+
+  <xsl:template match="sear:DOC">
+    <pz:record>
+      <xsl:apply-templates />
+    </pz:record>
+  </xsl:template>
+
+  <xsl:template match="prim:PrimoNMBib">
+    <xsl:apply-templates />
+  </xsl:template>
+  
+  <xsl:template match="prim:control"> 
+    <xsl:for-each select="prim:recordid">
+      <pz:metadata type="id">
+       <xsl:value-of select="."/>
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="prim:addata">
+    <!--    <xsl:variable name="yearmonthday" select="@date" /> -->
+
+    <xsl:for-each select="prim:date">
+      <pz:metadata type="date">
+       <xsl:value-of select="substring(.,1,4)" />
+      </pz:metadata>
+      <pz:metadata type="journal-month">
+       <xsl:value-of select="substring(.,4,1)" />
+      </pz:metadata>
+    </xsl:for-each>
+
+    <xsl:for-each select="prim:volume">
+      <pz:metadata type="journal-number">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+
+    <xsl:for-each select="prim:issue">
+      <pz:metadata type="issue-number">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+
+    <xsl:for-each select="prim:issn">
+      <pz:metadata type="issn">
+        <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+
+    <xsl:for-each select="prim:jtitle">
+      <pz:metadata type="journal-title">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="prim:delivery">  
+
+    <xsl:if test="$has_fulltext">
+      <pz:metadata type="has-fulltext">
+        <xsl:value-of select="$has_fulltext" />
+      </pz:metadata>
+    </xsl:if>
+
+  </xsl:template>
+
+  <xsl:template match="prim:display">
+    <xsl:for-each select="prim:creator">
+       <pz:metadata type="author">
+        <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>  
+    <xsl:for-each select="prim:type">
+      <xsl:variable name="type" select="."/>
+      <pz:metadata type="medium">
+       <xsl:choose>
+          <xsl:when test="$type ='article' and $has_fulltext = 'yes'">
+           <xsl:text>e-article</xsl:text>
+         </xsl:when>
+          <xsl:when  test="$type = 'article' and $has_fulltext = 'no'">
+           <xsl:text>article</xsl:text>
+         </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$type"/>
+          </xsl:otherwise>
+       </xsl:choose>
+<!--        <xsl:value-of select="$type" /> -->
+      </pz:metadata>
+      <pz:metadata type="debug_isarticle"><xsl:value-of select="$is_article"/></pz:metadata>
+    </xsl:for-each>  
+
+    <xsl:for-each select="prim:title">
+      <pz:metadata type="title">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>  
+
+    <xsl:for-each select="prim:ispartof">
+      <pz:metadata type="journal-subpart">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+<!--
+    <xsl:apply-templates />
+-->
+  </xsl:template>
+
+  <xsl:template match="prim:facets">
+    <xsl:for-each select="prim:topic">
+       <pz:metadata type="subject">
+        <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>  
+  </xsl:template>
+
+  <xsl:template match="sear:LINKS" >
+    <xsl:for-each select="sear:openurl"> 
+      <pz:metadata type="electronic-url">
+       <xsl:value-of select="."/>
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="prim:search">
+    <xsl:for-each select="prim:description">
+      <pz:metadata type="description">
+       <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+
+
+    <xsl:for-each select="prim:sub">
+      <pz:metadata type="subject">
+        <xsl:value-of select="." />
+      </pz:metadata>
+    </xsl:for-each>
+
+    <!-- passthrough id data -->
+    <xsl:for-each select="pz:metadata">
+      <xsl:copy-of select="." />
+    </xsl:for-each>
+    <!-- other stylesheets importing this might want to define this -->
+
+    <xsl:call-template name="record-hook" />   
+  </xsl:template>
+
+  <xsl:template match="text()" />
+
+</xsl:stylesheet>
diff --git a/etc/xsl/pz2-ourl-base.xsl b/etc/xsl/pz2-ourl-base.xsl
new file mode 100644 (file)
index 0000000..260dc9f
--- /dev/null
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim"
+    xmlns:str="http://exslt.org/strings"
+    extension-element-prefixes="str">
+
+  <xsl:param name="open_url_resolver"/>
+  <!--<xsl:variable name="resolver">http://zeus.lib.uoc.gr:3210/sfxtst3</xsl:variable>-->
+  <xsl:template name="insert-md-openurl">
+  
+    <xsl:value-of select="$open_url_resolver" /><xsl:text>?generatedby=pz2</xsl:text>
+    <xsl:call-template name="ou-parse-author" />
+    <xsl:call-template name="ou-parse-date" />
+    <xsl:call-template name="ou-parse-volume" />
+    <xsl:call-template name="ou-parse-any">
+      <xsl:with-param name="field_name" select="string('isbn')" />
+    </xsl:call-template>
+    <xsl:call-template name="ou-parse-any">
+      <xsl:with-param name="field_name" select="string('issn')" />
+    </xsl:call-template>
+    <xsl:call-template name="ou-parse-any">
+      <xsl:with-param name="field_name" select="string('title')" />
+    </xsl:call-template>
+    <xsl:call-template name="ou-parse-any">
+      <xsl:with-param name="field_name" select="string('atitle')" />
+    </xsl:call-template>
+
+  </xsl:template>
+  <!-- parsing raw string data -->
+  
+  <xsl:template name="ou-parse-author" >
+    <xsl:variable name="author">
+      <xsl:call-template name="ou-author" />
+    </xsl:variable>
+    
+    <xsl:variable name="aulast" select="normalize-space(substring-before($author, ','))"/>
+
+    <xsl:variable name="aufirst" 
+      select="substring-before( normalize-space(substring-after($author, ',')), ' ')"/>
+
+    <xsl:if test="$aulast != ''">
+      <xsl:text>&amp;aulast=</xsl:text>
+      <xsl:value-of select="$aulast" />
+    </xsl:if>
+
+    <xsl:if test="string-length( translate($aufirst, '.', '') ) &gt; 1" >
+      <xsl:text>&amp;aufirst=</xsl:text>
+      <xsl:value-of select="$aufirst" />
+    </xsl:if>
+
+  </xsl:template>
+
+  <xsl:template name="ou-parse-volume">
+    <xsl:variable name="volume">
+      <xsl:call-template name="ou-volume" />
+    </xsl:variable>
+
+    <xsl:variable name="vol" select="substring-after($volume, 'Vol')"/>
+    <xsl:variable name="issue" select="false()" />
+    <xsl:variable name="spage" select="false()" />
+
+    <xsl:if test="$vol">
+      <xsl:text>&amp;volume=</xsl:text>
+      <xsl:value-of select="$vol" />
+    </xsl:if>
+
+    <xsl:if test="$issue">
+      <xsl:text>&amp;issue=</xsl:text>
+      <xsl:value-of select="$issue" />
+    </xsl:if>
+    
+    <xsl:if test="$spage">
+      <xsl:text>&amp;spage=</xsl:text>
+      <xsl:value-of select="$vol" />
+    </xsl:if>
+
+  </xsl:template>
+
+
+  <xsl:template name="ou-parse-date">
+    <xsl:variable name="date">
+      <xsl:call-template name="ou-date" />
+    </xsl:variable>
+
+    <xsl:variable name="parsed_date" select="translate($date, '.[]c;', '')"/>
+
+    <xsl:if test="$parsed_date">
+      <xsl:text>&amp;date=</xsl:text>
+      <xsl:value-of select="$parsed_date" />
+    </xsl:if>
+
+  </xsl:template>
+
+  
+  <xsl:template name="ou-parse-any">
+    <xsl:param name="field_name" />
+
+    <xsl:variable name="field_value">
+      <xsl:choose>
+
+      <xsl:when test="$field_name = 'isbn'">
+        <xsl:call-template name="ou-isbn"/>
+      </xsl:when>
+
+      <xsl:when test="$field_name = 'issn'">
+        <xsl:call-template name="ou-issn"/>
+      </xsl:when>
+      
+      <xsl:when test="$field_name = 'atitle'">
+        <xsl:call-template name="ou-atitle"/>
+      </xsl:when>
+     
+      <xsl:when test="$field_name = 'title'">
+        <xsl:call-template name="ou-title"/>
+      </xsl:when>
+
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="digits" select="1234567890"/>
+
+    <xsl:variable name="parsed_value">
+      <xsl:choose>
+
+      <xsl:when test="$field_name = 'isbn'">
+        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, 'X'), ''), '')"/>
+      </xsl:when>
+
+      <xsl:when test="$field_name = 'issn'">
+        <xsl:value-of select="translate($field_value, translate($field_value, concat($digits, '-', 'X'), ''), '')"/>
+      </xsl:when>
+      
+      <xsl:when test="$field_name = 'atitle'">
+        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
+      </xsl:when>
+     
+      <xsl:when test="$field_name = 'title'">
+        <xsl:value-of select="translate(normalize-space($field_value), '.', '')"/>
+      </xsl:when>
+
+      </xsl:choose>
+    </xsl:variable>
+
+
+    <xsl:if test="$parsed_value != ''">
+      <xsl:text>&amp;</xsl:text>
+      <xsl:value-of select="$field_name" />
+      <xsl:text>=</xsl:text>
+      <xsl:value-of select="$parsed_value" />
+    </xsl:if>
+
+  </xsl:template>
+
+
+</xsl:stylesheet>
+<!--
+/*
+ * Local variables:
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=2 tabstop=4 expandtab
+ */
+-->
diff --git a/etc/xsl/pz2-ourl-marc21.xsl b/etc/xsl/pz2-ourl-marc21.xsl
new file mode 100644 (file)
index 0000000..1c8efde
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim"
+    xmlns:str="http://exslt.org/strings"
+    extension-element-prefixes="str">  
+  
+  <xsl:import href="pz2-ourl-base.xsl"/>
+
+  <xsl:template name="ou-author" >
+  <!-- what to do with multiple authors??-->
+    <xsl:for-each select="marc:datafield[@tag='100' or @tag='700']">
+      <xsl:value-of select="marc:subfield[@code='a']"/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="ou-title" >
+  <!-- if 773 exists its a journal/article -->
+    <xsl:choose>
+    
+      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='t']">
+        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
+      </xsl:when>
+
+      <xsl:when test="marc:datafield[@tag='245']/marc:subfield[@code='a']">
+        <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
+      </xsl:when>
+
+    </xsl:choose>
+  </xsl:template>
+
+  
+  <xsl:template name="ou-atitle" >
+    <!-- return value only if article or journal -->
+    <xsl:if test="marc:datafield[@tag='773']">
+      <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
+    </xsl:if>
+  </xsl:template>
+
+
+  <xsl:template name="ou-date" >
+    <xsl:for-each select="marc:datafield[@tag='260']">
+      <xsl:value-of select="marc:subfield[@code='c']"/>
+    </xsl:for-each>
+  </xsl:template>
+
+  
+  <xsl:template name="ou-isbn" >
+  <!-- if 773 exists its a journal/article -->
+    <xsl:choose>  
+    
+      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='z']">
+        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='z']"/>
+      </xsl:when>
+      
+      <xsl:when test="marc:datafield[@tag='020']/marc:subfield[@code='a']">
+        <xsl:value-of select="marc:datafield[@tag='020']/marc:subfield[@code='a']"/>
+      </xsl:when>
+
+    </xsl:choose>
+  </xsl:template>
+
+  
+  <xsl:template name="ou-issn" >
+  <!-- if 773 exists its a journal/article -->
+    <xsl:choose>
+    
+      <xsl:when test="marc:datafield[@tag='773']/marc:subfield[@code='x']">
+        <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='x']"/>
+      </xsl:when>
+
+      <xsl:when test="marc:datafield[@tag='022']/marc:subfield[@code='a']">
+        <xsl:value-of select="marc:datafield[@tag='022']/marc:subfield[@code='a']"/>
+      </xsl:when>
+
+      </xsl:choose>
+  </xsl:template>
+
+  
+  <xsl:template name="ou-volume" >
+    <xsl:if test="marc:datafield[@tag='773']">
+         <xsl:value-of select="marc:datafield[@tag='773']/marc:subfield[@code='g']"/>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>
+<!--
+/*
+ * Local variables:
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=2 tabstop=4 expandtab
+ */
+-->
diff --git a/etc/xsl/solr-pz2.xsl b/etc/xsl/solr-pz2.xsl
new file mode 100644 (file)
index 0000000..f6fa5dd
--- /dev/null
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+               xmlns:pz="http://www.indexdata.com/pazpar2/1.0" >
+
+  <xsl:param name="medium" />
+
+  <xsl:template  match="/">
+      <xsl:apply-templates></xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template  match="response">
+      <xsl:apply-templates></xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template  match="records">
+      <xsl:apply-templates></xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="doc">
+    <pz:record>
+      <xsl:if test="string-length($medium) &gt; 0">
+        <pz:metadata type="medium">
+           <xsl:value-of select="$medium"/>
+        </pz:metadata>
+      </xsl:if>
+      <xsl:apply-templates></xsl:apply-templates>
+    </pz:record>
+  </xsl:template>
+
+  <xsl:template match="float[@name]">
+    <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="@name"/>
+       </xsl:attribute>
+       <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="str[@name]">
+    <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="@name"/>
+       </xsl:attribute>
+       <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="date[@name]">
+    <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="@name"/>
+       </xsl:attribute>
+       <xsl:value-of select="."/>
+    </pz:metadata>
+  </xsl:template>
+
+  <xsl:template match="arr">
+    <xsl:for-each select="str">
+      <xsl:call-template name="string"/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="string">
+      <pz:metadata>
+       <xsl:attribute  name="type">
+         <xsl:value-of select="../@name"/>
+       </xsl:attribute>
+       <xsl:choose>
+         <xsl:when test="../@name = 'medium' and string-length($medium) = 0">
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:value-of select="."/>
+         </xsl:otherwise>
+       </xsl:choose>
+      </pz:metadata>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/etc/xsl/tmarc.xsl b/etc/xsl/tmarc.xsl
new file mode 100644 (file)
index 0000000..95e9975
--- /dev/null
@@ -0,0 +1,829 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+  xmlns="http://www.indexdata.com/turbomarc"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+  xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+  xmlns:tmarc="http://www.indexdata.com/turbomarc">
+
+  <xsl:output indent="yes" method="xml" version="1.0"
+    encoding="UTF-8" />
+  <xsl:param name="medium"/>
+
+  <!-- Extract metadata from MARC21/USMARC from streamlined marcxml format 
+    http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
+  <xsl:template name="record-hook" />
+
+
+  <xsl:template match="/">
+      <xsl:apply-templates />
+  </xsl:template>
+
+  <xsl:template match="tmarc:collection">
+    <collection>
+      <xsl:apply-templates />
+    </collection>
+  </xsl:template>
+
+  <xsl:template match="tmarc:r">
+    <xsl:variable name="title_medium" select="tmarc:d245/tmarc:sh" />
+    <xsl:variable name="journal_title" select="tmarc:d773/tmarc:st" />
+    <xsl:variable name="electronic_location_url" select="tmarc:d856/tmarc:su" />
+    <xsl:variable name="fulltext_a" select="tmarc:d900/tmarc:sa" />
+    <xsl:variable name="fulltext_b" select="tmarc:d900/tmarc:sb" />
+    <!-- Does not always hit the right substring. The field is not always fixed-width? -->
+    <xsl:variable name="control_lang" select="substring(tmarc:c008, 36, 3)" />
+    <xsl:variable name="contains110" select="tmarc:d110" />
+    <xsl:variable name="hasAuthorFields" select="tmarc:d100 or tmarc:d111" />
+    <xsl:variable name="typeofrec" select="substring(tmarc:l, 7, 1)"/>
+    <xsl:variable name="typeofvm" select="substring(tmarc:c008, 34, 1)"/>
+    <xsl:variable name="biblevel" select="substring(tmarc:l, 8, 1)"/>
+    <xsl:variable name="physdes" select="substring(tmarc:c007, 1, 1)"/>
+    <xsl:variable name="form1" select="substring(tmarc:c008, 24, 1)"/>
+    <xsl:variable name="form2" select="substring(tmarc:c008, 30, 1)"/>
+    <xsl:variable name="oclca" select="substring(tmarc:c007, 1, 1)"/>
+    <xsl:variable name="oclcb" select="substring(tmarc:c007, 2, 1)"/>
+    <xsl:variable name="oclcd" select="substring(tmarc:c007, 4, 1)"/>
+    <xsl:variable name="oclce" select="substring(tmarc:c007, 5, 1)"/>
+    <xsl:variable name="typeofserial" select="substring(tmarc:c008, 22, 1)"/>
+
+    <xsl:variable name="electronic">
+      <xsl:choose>
+        <xsl:when test="$form1='s' or $form1='q' or $form1='o' or
+          $form2='s' or $form2='q' or $form2='o'">
+          <xsl:text>yes</xsl:text>
+       </xsl:when>
+       <xsl:otherwise/>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="vmedium">
+      <xsl:choose>
+        <xsl:when test="string-length($medium)"><xsl:value-of select="$medium" /></xsl:when>
+        <xsl:when test="($typeofrec='a' or $typeofrec='t') and $biblevel='m'">book</xsl:when>
+        <xsl:when test="$typeofrec='j' or $typeofrec='i'">
+         <xsl:text>recording</xsl:text>
+         <xsl:choose>
+           <xsl:when test="$oclcb='d' and $oclcd='f'">-cd</xsl:when>
+           <xsl:when test="$oclcb='s'">-cassette</xsl:when>
+           <xsl:when test="$oclcb='d' and $oclcd='a' or $oclcd='b' or
+             $oclcd='c' or $oclcd='d' or $oclcd='e'">-vinyl</xsl:when>
+         </xsl:choose>
+       </xsl:when>
+       <xsl:when test="$typeofrec='g'">
+         <xsl:choose>
+           <xsl:when test="$typeofvm='m' or $typeofvm='v'">
+             <xsl:text>video</xsl:text>
+             <xsl:choose>
+               <xsl:when test="$oclca='v' and $oclcb='d' and $oclce='v'">-dvd</xsl:when>
+               <xsl:when test="$oclca='v' and $oclcb='d' and $oclce='s'">-blu-ray</xsl:when>
+               <xsl:when test="$oclca='v' and $oclcb='f' and $oclce='b'">-vhs</xsl:when>
+             </xsl:choose>
+           </xsl:when>
+           <xsl:otherwise>audio-visual</xsl:otherwise>
+         </xsl:choose>
+       </xsl:when>
+       <xsl:when test="$typeofrec='a' and $biblevel='s'">
+         <xsl:choose>
+           <xsl:when test="$typeofserial='n'">newspaper</xsl:when>
+           <xsl:otherwise>journal</xsl:otherwise>
+         </xsl:choose>
+       </xsl:when>
+       <xsl:when test="$typeofrec='e' or $typeofrec='f'">map</xsl:when>
+       <xsl:when test="$typeofrec='c' or $typeofrec='d'">music-score</xsl:when>
+       <xsl:when test="$form1='a' or $form1='b' or $form1='c'">microform</xsl:when>
+       <xsl:when test="$typeofrec='t'">thesis</xsl:when>
+        <!-- <xsl:when test="$journal_title">article</xsl:when> -->
+       <xsl:when test="$typeofrec='a' or $typeofrec='i' and
+           ($typeofserial='d' or $typeofserial='w')">web</xsl:when>
+       <xsl:when test="$typeofrec='a' and $biblevel='b'">article</xsl:when>
+       <xsl:when test="$typeofrec='m'">electronic</xsl:when>
+        <xsl:otherwise>
+          <xsl:text>other</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="has_fulltext">
+      <xsl:choose>
+        <xsl:when test="tmarc:d856/tmarc:sq">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:when test="tmarc:d856/tmarc:si='TEXT*'">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>no</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="oclc_number">
+      <xsl:choose>
+        <xsl:when test='contains(tmarc:c001,"ocn") or
+                        contains(tmarc:c001,"ocm") or
+                        contains(tmarc:c001,"OCoLC") '>
+         <xsl:value-of select="tmarc:c001"/>
+        </xsl:when>
+        <xsl:when test='contains(tmarc:d035/tmarc:sa,"ocn") or
+                        contains(tmarc:d035/tmarc:sa,"ocm") or
+                        contains(tmarc:d035/tmarc:sa,"OCoLC") '>
+         <xsl:value-of select="tmarc:d035/tmarc:sa"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="date_008">
+      <xsl:choose>
+        <xsl:when test="contains('cestpudikmr', substring(tmarc:c008, 7, 1))">
+          <xsl:value-of select="substring(tmarc:c008, 8, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="date_end_008">
+      <xsl:choose>
+        <xsl:when test="contains('dikmr', substring(tmarc:c008, 7, 1))">
+          <xsl:value-of select="substring(tmarc:c008, 12, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <pz:record>
+<!--
+      <xsl:attribute name="mergekey">
+    <xsl:text>title </xsl:text>
+  <xsl:value-of select="tmarc:d245/tmarc:sa" />
+  <xsl:text> author </xsl:text>
+  <xsl:value-of select="tmarc:d100/tmarc:sa" />
+  <xsl:text> medium </xsl:text>
+  <xsl:value-of select="$medium" />
+    </xsl:attribute>
+  -->
+
+      <xsl:for-each select="tmarc:c001">
+        <pz:metadata type="id">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:if test="string-length($oclc_number) &gt; 0">
+       <pz:metadata type="oclc-number">
+         <xsl:value-of select="$oclc_number" />
+       </pz:metadata>
+      </xsl:if>
+
+      <xsl:for-each select="tmarc:d010">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="lccn">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d020">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="isbn">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d022">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="issn">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+      
+      <xsl:for-each select="tmarc:d027">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="tech-rep-nr">
+           <xsl:value-of select="tmarc:sa" />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+      
+      <xsl:for-each select="tmarc:d035"> 
+        <pz:metadata type="system-control-nr">
+          <xsl:choose>
+            <xsl:when test="tmarc:sa">
+              <xsl:value-of select="tmarc:sa"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="tmarc:sb"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d100">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="author">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="author-title">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sd">
+         <pz:metadata type="author-date">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d110">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="corporate-name">
+          <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="corporate-location">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sd">
+         <pz:metadata type="corporate-date">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+      
+      <xsl:for-each select="tmarc:d111">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="meeting-name">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="meeting-location">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sd">
+         <pz:metadata type="meeting-date">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d260">
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="date">
+           <xsl:value-of select="translate(., 'cp[].', '')" />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:if test="string-length($date_008) &gt; 0 and not(tmarc:d260)">
+        <pz:metadata type="date">
+          <xsl:choose>
+            <xsl:when test="$date_end_008">
+              <xsl:value-of select="concat($date_008,'-',$date_end_008)" />
+            </xsl:when>
+            <xsl:otherwise> 
+              <xsl:value-of select="$date_008" />
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:if>
+
+      <xsl:for-each select="tmarc:d130">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="title-uniform">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sm">
+         <pz:metadata type="title-uniform-media">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sn">
+         <pz:metadata type="title-uniform-parts">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sp">
+         <pz:metadata type="title-uniform-partname">
+           <xsl:value-of select="." />     
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sr">
+         <pz:metadata type="title-uniform-key">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+      
+      <xsl:for-each select="tmarc:d245">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="title">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sb">
+         <pz:metadata type="title-remainder">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="title-responsibility">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sf">
+         <pz:metadata type="title-dates">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sh">
+         <pz:metadata type="title-medium">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sn">
+         <pz:metadata type="title-number-section">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:if test="tmarc:sa">
+         <pz:metadata type="title-complete">
+           <xsl:value-of select="tmarc:sa" />
+           <xsl:if test="tmarc:sb" ><xsl:value-of select="concat(' ', tmarc:sb)" /></xsl:if>
+         </pz:metadata>
+       </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d250">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="edition">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d260">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="publication-place">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sb">
+         <pz:metadata type="publication-name">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="publication-date">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d300">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="physical-extent">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sb">
+         <pz:metadata type="physical-format">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sc">
+         <pz:metadata type="physical-dimensions">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:se">
+         <pz:metadata type="physical-accomp">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sf">
+         <pz:metadata type="physical-unittype">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sg">
+         <pz:metadata type="physical-unitsize">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:s3">
+         <pz:metadata type="physical-specified">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d440">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="series-title">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d500">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d505">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d518">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d520">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d522">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d911">
+        <pz:metadata type="description">
+          <xsl:for-each select="node()">
+            <xsl:value-of select="text()" />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d600 | tmarc:d610 | tmarc:d611 | tmarc:d630 |
+                            tmarc:d648 | tmarc:d650 | tmarc:d651 | tmarc:d653 |
+                            tmarc:d654 | tmarc:d655 | tmarc:d656 | tmarc:d657 |
+                            tmarc:d658 | tmarc:d662 | tmarc:d69X">
+       <xsl:for-each select="tmarc:sa">
+         <pz:metadata type="subject">
+           <xsl:value-of select="."/>
+         </pz:metadata>
+       </xsl:for-each>
+       <pz:metadata type="subject-long">
+           <xsl:for-each select="node()/text()">
+             <xsl:if test="position() &gt; 1">
+               <xsl:text>, </xsl:text>
+             </xsl:if>
+            <xsl:variable name='value'>
+              <xsl:value-of select='normalize-space(.)'/>
+            </xsl:variable>
+            <xsl:choose>
+              <xsl:when test="substring($value, string-length($value)) = ','">
+                <xsl:value-of select="substring($value, 1, string-length($value)-1)"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$value"/>
+              </xsl:otherwise>
+            </xsl:choose> 
+          </xsl:for-each>
+         </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d856">
+       <xsl:for-each select="tmarc:su">
+         <pz:metadata type="electronic-url">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+        <pz:metadata type="electronic-text">
+         <xsl:choose>
+           <xsl:when test="tmarc:sy">
+             <xsl:value-of select="tmarc:sy/text()" />
+           </xsl:when>
+           <xsl:when test="tmarc:s3">
+             <xsl:value-of select="tmarc:s3/text()" />
+           </xsl:when>
+           <xsl:when test="tmarc:sa">
+             <xsl:value-of select="tmarc:sa/text()" />
+           </xsl:when>
+           <xsl:otherwise>Get resource</xsl:otherwise>
+         </xsl:choose>
+        </pz:metadata>
+       <xsl:for-each select="tmarc:sz">
+         <pz:metadata type="electronic-note">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:si">
+         <pz:metadata type="electronic-format-instruction">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+       <xsl:for-each select="tmarc:sq">
+         <pz:metadata type="electronic-format-type">
+           <xsl:value-of select="." />
+         </pz:metadata>
+       </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d773">
+        <pz:metadata type="citation">
+          <xsl:for-each select="*">
+            <xsl:value-of select="normalize-space(.)" />
+            <xsl:text> </xsl:text>
+          </xsl:for-each>
+        </pz:metadata>
+        <xsl:for-each select="tmarc:st">
+          <pz:metadata type="journal-title">
+            <xsl:value-of select="."/>
+          </pz:metadata>
+        </xsl:for-each>
+        <xsl:if test="tmarc:sg">
+         <xsl:variable name="value">
+            <xsl:for-each select="tmarc:sg">
+              <xsl:value-of select="."/>
+            </xsl:for-each>
+         </xsl:variable>
+          <pz:metadata type="journal-subpart">
+            <xsl:value-of select="$value"/>
+         </pz:metadata>
+         <xsl:variable name="l">
+           <xsl:value-of select="translate($value,
+                                 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.',
+                                 'abcdefghijklmnopqrstuvwxyz ') "/>
+         </xsl:variable>
+         <xsl:variable name="volume">
+           <xsl:choose>
+             <xsl:when test="string-length(substring-after($l,'vol ')) &gt; 0">
+               <xsl:value-of select="substring-before(normalize-space(substring-after($l,'vol ')),' ')"/>
+             </xsl:when>
+             <xsl:when test="string-length(substring-after($l,'v ')) &gt; 0">
+               <xsl:value-of select="substring-before(normalize-space(substring-after($l,'v ')),' ')"/>
+             </xsl:when>
+           </xsl:choose>
+         </xsl:variable>
+         <xsl:variable name="issue">
+           <xsl:value-of select="substring-before(translate(normalize-space(substring-after($l,'issue')), ',', ' '),' ')"/>
+         </xsl:variable>
+         <xsl:variable name="pages">
+           <xsl:choose>
+             <xsl:when test="string-length(substring-after($l,' p ')) &gt; 0">
+               <xsl:value-of select="normalize-space(substring-after($l,' p '))"/>
+             </xsl:when>
+             <xsl:when test="string-length(substring-after($l,',p')) &gt; 0">
+               <xsl:value-of select="normalize-space(substring-after($l,',p'))"/>
+             </xsl:when>
+             <xsl:when test="string-length(substring-after($l,' p')) &gt; 0">
+               <xsl:value-of select="normalize-space(substring-after($l,' p'))"/>
+             </xsl:when>
+           </xsl:choose>
+         </xsl:variable>
+
+         <!-- volume -->
+         <xsl:if test="string-length($volume) &gt; 0">
+           <pz:metadata type="volume-number">
+             <xsl:value-of select="$volume"/>
+           </pz:metadata>
+         </xsl:if>
+         <!-- issue -->
+         <xsl:if test="string-length($issue) &gt; 0">
+           <pz:metadata type="issue-number">
+             <xsl:value-of select="$issue"/>
+           </pz:metadata>
+         </xsl:if>
+         <!-- pages -->
+         <xsl:if test="string-length($pages) &gt; 0">
+           <pz:metadata type="pages-number">
+             <xsl:value-of select="$pages"/>
+           </pz:metadata>
+         </xsl:if>
+
+         <!-- season -->
+        </xsl:if>
+        <xsl:if test="tmarc:sp">
+          <pz:metadata type="journal-title-abbrev">
+            <xsl:value-of select="tmarc:sp"/>
+          </pz:metadata>
+        </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d852">
+        <xsl:for-each select="tmarc:sy">
+          <pz:metadata type="publicnote">
+            <xsl:value-of select="." />
+          </pz:metadata>
+        </xsl:for-each>
+        <xsl:for-each select="tmarc:sh">
+          <pz:metadata type="callnumber">
+            <xsl:value-of select="." />
+          </pz:metadata>
+        </xsl:for-each>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d876">
+        <xsl:if test="tmarc:sf">
+          <pz:metadata type="loan-period">
+            <xsl:value-of select="concat(tmarc:s5,':',tmarc:sf)" />
+          </pz:metadata>
+        </xsl:if>
+      </xsl:for-each>
+
+      <pz:metadata type="medium">
+        <xsl:value-of select="$vmedium" />
+       <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
+         <xsl:text> (electronic)</xsl:text>
+       </xsl:if>
+      </pz:metadata>
+
+      <xsl:for-each select="tmarc:d900/tmarc:sa">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_a"> <pz:metadata type="fulltext"> <xsl:value-of 
+        select="$fulltext_a"/> </pz:metadata> </xsl:if> -->
+
+      <xsl:for-each select="tmarc:d900/tmarc:sb">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:se">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:sf">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:si">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:sk">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:sq">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:ss">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:su">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d900/tmarc:sy">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d903">
+        <xsl:if test="tmarc:sa">
+          <pz:metadata type="publication-date">
+            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
+          </pz:metadata>
+          <pz:metadata type="date">
+            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
+          </pz:metadata>
+        </xsl:if>
+      </xsl:for-each>
+
+      <!-- <xsl:if test="$fulltext_b"> <pz:metadata type="fulltext"> <xsl:value-of 
+        select="$fulltext_b"/> </pz:metadata> </xsl:if> -->
+
+      <pz:metadata type="has-fulltext">
+        <xsl:value-of select="$has_fulltext"/>
+      </pz:metadata>
+
+      <xsl:for-each select="tmarc:d907 | tmarc:d901">
+        <pz:metadata type="iii-id">
+          <xsl:value-of select="tmarc:sa" />
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d926">
+        <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+        <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+        <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:se"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <!-- OhioLINK holdings -->
+      <xsl:for-each select="tmarc:d945">
+       <pz:metadata type="locallocation" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:sa"/>
+       </pz:metadata>
+       <pz:metadata type="callnumber" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:sb"/>
+       </pz:metadata>
+       <pz:metadata type="publicnote" empty="PAZPAR2_NULL_VALUE">
+         <xsl:value-of select="tmarc:sc"/>
+       </pz:metadata>
+       <pz:metadata type="available" empty="PAZPAR2_NULL_VALUE">
+          <xsl:choose>
+            <xsl:when test="tmarc:ss = 'N'">Available</xsl:when>
+            <xsl:otherwise>
+             <xsl:value-of select="tmarc:sd"/>
+           </xsl:otherwise>
+         </xsl:choose>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d948">
+        <pz:metadata type="holding">
+          <xsl:for-each select="tmarc:s">
+            <xsl:if test="position() > 1">
+              <xsl:text> </xsl:text>
+            </xsl:if>
+            <xsl:value-of select="." />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d991">
+        <pz:metadata type="holding">
+          <xsl:for-each select="tmarc:s">
+            <xsl:if test="position() > 1">
+              <xsl:text> </xsl:text>
+            </xsl:if>
+            <xsl:value-of select="." />
+          </xsl:for-each>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="tmarc:d999">
+        <pz:metadata type="localid">
+          <xsl:choose>
+            <xsl:when test="tmarc:sa">
+              <xsl:value-of select="tmarc:sa"/>
+            </xsl:when>
+            <xsl:when test="tmarc:sc">
+              <xsl:value-of select="tmarc:sc"/>
+            </xsl:when> 
+            <xsl:otherwise>
+              <xsl:value-of select="tmarc:sd"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:for-each>
+
+
+      <!-- passthrough id data -->
+      <xsl:for-each select="pz:metadata">
+        <xsl:copy-of select="." />
+      </xsl:for-each>
+
+      <!-- other stylesheets importing this might want to define this -->
+       <xsl:call-template name="record-hook" />
+
+    </pz:record>
+  </xsl:template>
+
+  <xsl:template match="text()" />
+
+</xsl:stylesheet>
diff --git a/etc/xsl/unimarc.xsl b/etc/xsl/unimarc.xsl
new file mode 100644 (file)
index 0000000..4842e24
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:marc="http://www.loc.gov/MARC21/slim">
+
+ <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+
+  <xsl:template match="/marc:record">
+    <pz:record>
+
+      <xsl:for-each select="marc:controlfield[@tag='001']">
+        <pz:metadata type="id">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <!-- -->
+      <xsl:for-each select="marc:datafield[@tag='020']">
+       <xsl:if test="marc:subfield[@code='a'] = 'US'">
+          <pz:metadata type="lccn">
+           <xsl:value-of select="marc:subfield[@code='b']"/>
+         </pz:metadata>
+       </xsl:if>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='010']">
+        <pz:metadata type="isbn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag='011']">
+        <pz:metadata type="issn">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+
+      <xsl:for-each select="marc:datafield[@tag='200']">
+        <pz:metadata type="title">
+          <xsl:value-of select="marc:subfield[@code='a']"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+
+      <!-- Date of Pulbication -->
+      <xsl:for-each select="marc:datafield[@tag='210']">
+        <pz:metadata type="date">
+         <xsl:value-of select="marc:subfield[@code='d']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <!--  Usmarc 650 maps to unimarc 606 and marc21 653 maps to unimarc 610 -->
+      <xsl:for-each select="marc:datafield[@tag='606' or @tag='610']">
+       <pz:metadata type="subject">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="marc:datafield[@tag &gt;= 300 and @tag &lt;= 345]
+                            [@tag != '325']">
+        <pz:metadata type="description">
+            <xsl:value-of select="*/text()"/>
+        </pz:metadata>
+      </xsl:for-each>
+
+
+      <!-- Author : primary, alternative and secondary responsibility (equivalent marc21 tags : 100, 700 -->
+      <xsl:for-each select="marc:datafield[@tag='700' or @tag='701' or @tag='702']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+          <xsl:text>, </xsl:text>
+         <xsl:value-of select="marc:subfield[@code='b']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+      <!-- Author : marc21 tag 720 maps to unimarc 730
+      <xsl:for-each select="marc:datafield[@tag='730']">
+       <pz:metadata type="author">
+         <xsl:value-of select="marc:subfield[@code='a']"/>
+       </pz:metadata>
+      </xsl:for-each>
+      -->
+
+      <!-- -->
+      <xsl:for-each select="marc:datafield[@tag='856']">
+       <pz:metadata type="url">
+         <xsl:value-of select="marc:subfield[@code='u']"/>
+       </pz:metadata>
+      </xsl:for-each>
+
+    </pz:record>
+  </xsl:template>
+
+</xsl:stylesheet>
index c4ee13d..474cb17 100644 (file)
@@ -81,7 +81,7 @@ cp etc/default.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
 cp etc/services/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
 cp etc/settings/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/settings/
 cp -r etc/settings/mkc ${RPM_BUILD_ROOT}/etc/pazpar2/settings
-cp etc/*.xsl ${RPM_BUILD_ROOT}/etc/pazpar2/
+cp -r etc/xsl ${RPM_BUILD_ROOT}/etc/pazpar2
 mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
 install -m755 rpm/pazpar2.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/pazpar2
 echo "Alias /pazpar2 /usr/share/pazpar2" >${RPM_BUILD_ROOT}/etc/pazpar2/ap2pazpar2-js.cfg