experimental processing-instruction based indexing XSLT added
[idzebra-moved-to-github.git] / test / xslt / dom-index.xsl
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2   xmlns:m="http://www.loc.gov/MARC21/slim"
3   exclude-result-prefixes="m"
4   version="1.0">
5   <!-- $Id: dom-index.xsl,v 1.1 2007-02-12 14:00:20 marc Exp $ -->
6   <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
7   
8
9   <xsl:template match="text()"/>
10
11
12   <xsl:template match="/m:record">
13     <xsl:processing-instruction name="zebra-2.0">
14       <xsl:text>record id=</xsl:text>
15       <xsl:value-of select="normalize-space(m:controlfield[@tag='001'])"/>
16       <xsl:text> rank=</xsl:text>
17       <xsl:value-of select="normalize-space(m:rank)"/>
18     </xsl:processing-instruction>
19
20     <record>
21       <xsl:apply-templates/>
22     </record>
23   </xsl:template>
24
25   <xsl:template match="m:controlfield[@tag='001']">
26
27     <control>
28       <xsl:processing-instruction 
29           name="zebra-2.0">index control</xsl:processing-instruction>
30       <xsl:value-of select="normalize-space(.)"/>
31     </control>
32   </xsl:template>
33   
34   <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
35     <xsl:processing-instruction 
36         name="zebra-2.0">index title:w title:p title:s</xsl:processing-instruction>
37     <title>
38         <xsl:value-of select="."/>
39     </title>
40   </xsl:template>
41
42 </xsl:stylesheet>