XSLT filter reads z:record construct which may define record ID
[idzebra-moved-to-github.git] / test / xslt / index.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.dk/zebra/xslt/1"
4   version="1.0">
5   <!-- $Id: index.xsl,v 1.4 2005-06-24 13:45:54 adam 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     <z:record id="{normalize-space(m:controlfield[@tag='001'])}">
14       <xsl:apply-templates/>
15     </z:record>
16   </xsl:template>
17
18   <xsl:template match="m:controlfield[@tag='001']">
19     <z:index name="control">
20       <xsl:value-of select="."/>
21     </z:index>
22   </xsl:template>
23   
24   <xsl:template match="m:datafield[@tag='245']/m:subfield[@code='a']">
25     <z:index name="title">
26       <xsl:value-of select="."/>
27     </z:index>
28   </xsl:template>
29   
30
31
32 </xsl:stylesheet>