Added stylesheet for parsing OPAC records and extracting circ information
authorSebastian Hammer <quinn@indexdata.com>
Tue, 16 Jun 2009 18:16:03 +0000 (18:16 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Tue, 16 Jun 2009 18:16:03 +0000 (18:16 +0000)
etc/opac.xsl [new file with mode: 0644]

diff --git a/etc/opac.xsl b/etc/opac.xsl
new file mode 100644 (file)
index 0000000..57b2b5f
--- /dev/null
@@ -0,0 +1,34 @@
+<?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">
+        <xsl:value-of select="localLocation"/>
+      </pz:metadata>
+      <pz:metadata type="callnumber">
+        <xsl:value-of select="callNumber"/>
+      </pz:metadata>
+      <pz:metadata type="publicnote">
+        <xsl:value-of select="publicNote"/>
+      </pz:metadata>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="opacRecord/bibliographicRecord"/>
+  </xsl:template>
+
+</xsl:stylesheet>