Transcode from pz2 to SOLR format
authorDennis Schafroth <dennis@indexdata.com>
Wed, 4 Aug 2010 20:38:01 +0000 (22:38 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 4 Aug 2010 20:38:01 +0000 (22:38 +0200)
etc/pz2-solr.xsl [new file with mode: 0644]

diff --git a/etc/pz2-solr.xsl b/etc/pz2-solr.xsl
new file mode 100644 (file)
index 0000000..e2e0f04
--- /dev/null
@@ -0,0 +1,23 @@
+<?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">
+    <field>
+      <xsl:attribute  name="name">
+       <xsl:value-of select="@type"/>
+      </xsl:attribute>
+       <xsl:value-of select="."/>
+    </field>
+  </xsl:template>
+</xsl:stylesheet>