Tentatively add new indexes (to be checked against profile).
[irspy-moved-to-github.git] / zebra / zeerex2index.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: zeerex2index.xsl,v 1.2 2006-05-12 22:04:34 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
19    <z:index name="rec:id" type="0">
20     <xsl:value-of select="concat(
21                           e:serverInfo/e:host, ':',
22                           e:serverInfo/e:port, '/',
23                           e:serverInfo/e:database)"/>
24    </z:index>
25    <z:index name="net:protocol" type="w">
26     <xsl:value-of select="e:serverInfo/@protocol"/>
27    </z:index>
28    <z:index name="net:version" type="0">
29     <xsl:value-of select="e:serverInfo/@version"/>
30    </z:index>
31    <z:index name="net:method" type="w">
32     <xsl:value-of select="e:serverInfo/@method"/>
33    </z:index>
34    <z:index name="net:host" type="0">
35     <xsl:value-of select="e:serverInfo/e:host"/>
36    </z:index>
37    <z:index name="net:port" type="0">
38     <xsl:value-of select="e:serverInfo/e:port"/>
39    </z:index>
40    <z:index name="net:path" type="0">
41     <xsl:value-of select="e:serverInfo/e:database"/>
42    </z:index>
43
44    <z:index name="dc:title" type="w">
45     <xsl:value-of select="e:databaseInfo/e:title"/>
46    </z:index>
47    <z:index name="dc:creator" type="w">
48     <xsl:value-of select="e:databaseInfo/e:author"/>
49    </z:index>
50
51    <!-- ### index-name will be wrong -->
52    <z:index name="rec:date-modified" type="d">
53     <!-- ### Can Zebra handle this ISO-format date? -->
54     <xsl:value-of select="e:metaInfo/e:dateModified"/>
55    </z:index>
56
57    <!-- ### indexes -->
58
59    <!-- ### index-name will be wrong -->
60    <z:index name="zeerex:recordSyntax" type="0">
61     <xsl:value-of select="e:recordInfo/recordSyntax/@name"/>
62    </z:index>
63    <!-- ### schemas -->
64
65    <!-- ### supportsInfo -->
66   </z:record>
67  </xsl:template>
68 </xsl:stylesheet>