Cluster record example dkabm.xsl
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Nov 2013 12:37:08 +0000 (13:37 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 12 Nov 2013 12:37:08 +0000 (13:37 +0100)
Used by etc/settings/bibliotek.dk.xml .

etc/dkabm.xsl [new file with mode: 0644]
etc/settings/bibliotek.dk.xml [new file with mode: 0644]

diff --git a/etc/dkabm.xsl b/etc/dkabm.xsl
new file mode 100644 (file)
index 0000000..c0ebb03
--- /dev/null
@@ -0,0 +1,91 @@
+<?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/">
+
+ <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="dkabm:record">
+    <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/settings/bibliotek.dk.xml b/etc/settings/bibliotek.dk.xml
new file mode 100644 (file)
index 0000000..6dc6c21
--- /dev/null
@@ -0,0 +1,25 @@
+<settings target="localhost:9994/bibliotek.work">
+  <set name="pz:name" value="bibliotek.dk"/>
+  <set name="pz:apdulog" value="1"/>
+
+  <!-- mapping for unqualified search -->
+  <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
+
+  <!-- field-specific mappings -->
+  <set name="pz:cclmap:ti" value="u=4 s=al"/>
+  <set name="pz:cclmap:su" value="u=21 s=al"/>
+  <set name="pz:cclmap:isbn" value="u=7"/>
+  <set name="pz:cclmap:issn" value="u=8"/>
+  <set name="pz:cclmap:date" value="u=30 r=r"/>
+
+  <!-- Retrieval settings -->
+
+  <set name="pz:requestsyntax" value="xml"/>
+  <set name="pz:elements" value="dkabm"/>
+
+  <!-- Result normalization settings -->
+
+  <set name="pz:nativesyntax" value="xml"/>
+  <set name="pz:xslt" value="dkabm.xsl"/>
+
+</settings>