Omit CVS Id. Update copyright year.
[idzebra-moved-to-github.git] / test / xslt / dom-index-pi.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   <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
6   
7
8   <xsl:template match="text()"/>
9
10   <!--
11   <xsl:template match="processing-instruction()">
12     <xsl:copy-of select="."/>
13   </xsl:template>
14   -->
15
16   <xsl:template match="/m:record">
17     <xsl:processing-instruction name="zebra-2.0">
18       <xsl:text>record id=</xsl:text>
19       <xsl:value-of select="translate(normalize-space(m:controlfield[@tag='001']),' ','_')"/>
20       <xsl:text> rank=</xsl:text>
21       <xsl:value-of select="normalize-space(m:rank)"/>
22     </xsl:processing-instruction>
23
24     <record>
25       <xsl:apply-templates/>
26     </record>
27   </xsl:template>
28
29   <xsl:template match="m:controlfield[@tag='001']">
30
31     <xsl:processing-instruction 
32         name="zebra-2.0">index control:w</xsl:processing-instruction>
33     <control>
34       <xsl:value-of select="normalize-space(.)"/>
35     </control>
36   </xsl:template>
37   
38   <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
39     <xsl:processing-instruction 
40         name="zebra-2.0">index title:w title:p title:s</xsl:processing-instruction>
41     <title>
42         <xsl:value-of select="."/>
43     </title>
44   </xsl:template>
45
46 </xsl:stylesheet>