added tests for bug #883 'Need an 'ignore' value for the z:type
[idzebra-moved-to-github.git] / test / xslt / dom-index-skipped.xsl
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2   xmlns:m="http://www.loc.gov/MARC21/slim"
3   xmlns:z="http://indexdata.com/zebra-2.0"
4   exclude-result-prefixes="m z"
5   version="1.0">
6   <!-- $Id: dom-index-skipped.xsl,v 1.1 2007-03-05 13:02:11 marc Exp $ -->
7   <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
8   
9
10   <xsl:template match="text()"/>
11
12   <!-- skipping exactly first record with controlfield '11224466' -->
13   <xsl:template match="/m:record[normalize-space(m:controlfield[@tag='001']) =
14     '11224466']"/>
15
16   <!-- skipping exactly last record with controlfield '73090924' -->
17   <xsl:template match="/m:record[normalize-space(m:controlfield[@tag='001']) =
18     '73090924']"/>
19
20   <!-- and allowing one specific middle record -->
21   <xsl:template match="/m:record[normalize-space(m:controlfield[@tag='001']) =
22     '11224467']">
23     <z:record z:id="{normalize-space(m:controlfield[@tag='001'])}"
24         z:rank="{normalize-space(m:rank)}">
25       <xsl:apply-templates/>
26     </z:record>
27   </xsl:template>
28
29   <xsl:template match="m:controlfield[@tag='001']">
30     <z:index name="control">
31       <xsl:value-of select="normalize-space(.)"/>
32     </z:index>
33   </xsl:template>
34   
35   <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
36     <z:index name="title:w title:p title:s any:w">
37       <xsl:value-of select="."/>
38     </z:index>
39   </xsl:template>
40
41 </xsl:stylesheet>