3f11dfd7aceeb4e89fd0698318aaba243b4fea35
[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   <!-- $Id: dom-index-pi.xsl,v 1.1 2007-02-15 13:01:00 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="processing-instruction()">
13     <xsl:copy-of select="."/>
14   </xsl:template>
15   -->
16
17   <xsl:template match="/m:record">
18     <xsl:processing-instruction name="zebra-2.0">
19       <xsl:text>record id=</xsl:text>
20       <xsl:value-of select="normalize-space(m:controlfield[@tag='001'])"/>
21       <xsl:text> rank=</xsl:text>
22       <xsl:value-of select="normalize-space(m:rank)"/>
23     </xsl:processing-instruction>
24
25     <record>
26       <xsl:apply-templates/>
27     </record>
28   </xsl:template>
29
30   <xsl:template match="m:controlfield[@tag='001']">
31
32     <xsl:processing-instruction 
33         name="zebra-2.0">index control:w</xsl:processing-instruction>
34     <control>
35       <xsl:value-of select="normalize-space(.)"/>
36     </control>
37   </xsl:template>
38   
39   <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
40     <xsl:processing-instruction 
41         name="zebra-2.0">index title:w title:p title:s</xsl:processing-instruction>
42     <title>
43         <xsl:value-of select="."/>
44     </title>
45   </xsl:template>
46
47 </xsl:stylesheet>