experimental processing-instruction based indexing XSLT added
authorMarc Cromme <marc@indexdata.dk>
Mon, 12 Feb 2007 14:00:20 +0000 (14:00 +0000)
committerMarc Cromme <marc@indexdata.dk>
Mon, 12 Feb 2007 14:00:20 +0000 (14:00 +0000)
test/xslt/dom-index.xsl [new file with mode: 0644]

diff --git a/test/xslt/dom-index.xsl b/test/xslt/dom-index.xsl
new file mode 100644 (file)
index 0000000..b372b81
--- /dev/null
@@ -0,0 +1,42 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:m="http://www.loc.gov/MARC21/slim"
+  exclude-result-prefixes="m"
+  version="1.0">
+  <!-- $Id: dom-index.xsl,v 1.1 2007-02-12 14:00:20 marc Exp $ -->
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+  
+
+  <xsl:template match="text()"/>
+
+
+  <xsl:template match="/m:record">
+    <xsl:processing-instruction name="zebra-2.0">
+      <xsl:text>record id=</xsl:text>
+      <xsl:value-of select="normalize-space(m:controlfield[@tag='001'])"/>
+      <xsl:text> rank=</xsl:text>
+      <xsl:value-of select="normalize-space(m:rank)"/>
+    </xsl:processing-instruction>
+
+    <record>
+      <xsl:apply-templates/>
+    </record>
+  </xsl:template>
+
+  <xsl:template match="m:controlfield[@tag='001']">
+
+    <control>
+      <xsl:processing-instruction 
+          name="zebra-2.0">index control</xsl:processing-instruction>
+      <xsl:value-of select="normalize-space(.)"/>
+    </control>
+  </xsl:template>
+  
+  <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
+    <xsl:processing-instruction 
+        name="zebra-2.0">index title:w title:p title:s</xsl:processing-instruction>
+    <title>
+        <xsl:value-of select="."/>
+    </title>
+  </xsl:template>
+
+</xsl:stylesheet>