New
[irspy-moved-to-github.git] / zebra / zeerex2index.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: zeerex2index.xsl,v 1.1 2006-04-13 14:53:18 mike Exp $ -->
3 <!-- See the ZeeRex profile at http://srw.cheshire3.org/profiles/ZeeRex/ -->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5                 xmlns:z="http://indexdata.dk/zebra/xslt/1"
6                 xmlns:e="http://explain.z3950.org/dtd/2.0/"
7                 version="1.0">
8  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
9  <!-- disable all default text node output -->
10  <xsl:template match="text()"/>
11  <!-- match on alvis xml record -->
12  <xsl:template match="//e:explain">
13   <z:record id="{concat(
14                 e:serverInfo/e:host, ':',
15                 e:serverInfo/e:port, '/',
16                 e:serverInfo/e:database)}"
17             type="update">
18    <z:index name="rec:id" type="0">
19     <xsl:value-of select="concat(
20                           e:serverInfo/e:host, ':',
21                           e:serverInfo/e:port, '/',
22                           e:serverInfo/e:database)"/>
23    </z:index>
24    <z:index name="net:protocol" type="w">
25     <xsl:value-of select="e:serverInfo/@protocol"/>
26    </z:index>
27    <z:index name="net:version" type="0">
28     <xsl:value-of select="e:serverInfo/@version"/>
29    </z:index>
30    <z:index name="net:method" type="w">
31     <xsl:value-of select="e:serverInfo/@method"/>
32    </z:index>
33    <z:index name="net:host" type="0">
34     <xsl:value-of select="e:serverInfo/e:host"/>
35    </z:index>
36    <z:index name="net:port" type="0">
37     <xsl:value-of select="e:serverInfo/e:port"/>
38    </z:index>
39    <z:index name="net:path" type="0">
40     <xsl:value-of select="e:serverInfo/e:database"/>
41    </z:index>
42    <z:index name="dc:title" type="w">
43     <xsl:value-of select="e:databaseInfo/e:title"/>
44    </z:index>
45    <z:index name="dc:creator" type="w">
46     <xsl:value-of select="e:databaseInfo/e:author"/>
47    </z:index>
48   </z:record>
49  </xsl:template>
50 </xsl:stylesheet>