aded record indexing rule - now need to do all seperate indexes
[idzebra-moved-to-github.git] / examples / marcxml / MARC21slim2INDEX.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet 
3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4     xmlns:z="http://indexdata.dk/zebra/xslt/1" 
5     xmlns:marc="http://www.loc.gov/MARC21/slim" 
6     version="1.0">
7
8   <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/>
9   <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
10
11   <!-- disable all default text node output -->
12   <xsl:template match="text()"/>
13
14   <xsl:template match="/">
15     <xsl:if test="marc:collection">
16       <collection>
17         <xsl:apply-templates select="marc:record"/>
18       </collection>
19     </xsl:if>
20     <xsl:if test="marc:record">
21        <xsl:apply-templates select="marc:record"/>
22     </xsl:if>
23   </xsl:template>
24
25
26   <!-- match on marcxml record -->
27   <xsl:template match="marc:record">
28     <xsl:variable name="controlField001" select="marc:controlfield[@tag=001]"/>
29     <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
30     <z:record id="{$controlField001}" type="update">
31       <!-- <xsl:attribute name="id"></xsl:attribute> -->
32       <!-- <xsl:attribute name="type">update</xsl:attribute> -->
33       <!-- <xsl:attribute name="rank"></xsl:attribute> -->
34     </z:record>
35   </xsl:template>
36 </xsl:stylesheet>