Bug 11750: (QA follow-up) Remove unconditional warn
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim9522852.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE stylesheet>
3 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
4 <xsl:stylesheet version="1.0"
5   xmlns:marc="http://www.loc.gov/MARC21/slim"
6   xmlns:dc="http://purl.org/dc/elements/1.1/"
7   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8   exclude-result-prefixes="marc">
9         <xsl:import href="MARC21slimUtils.xsl"/>
10     <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
11         
12         <xsl:template match="/">
13                         <xsl:apply-templates/>
14         </xsl:template>
15
16         <xsl:template match="marc:record">
17                 <xsl:variable name="leader" select="marc:leader"/>
18                 <xsl:variable name="controlField001" select="marc:controlfield[@tag=001]"/>
19                 <xsl:variable name="controlField003" select="marc:controlfield[@tag=003]"/>
20                 <xsl:variable name="controlField005" select="marc:controlfield[@tag=005]"/>
21                 <xsl:variable name="controlField006" select="marc:controlfield[@tag=006]"/>
22                 <xsl:variable name="controlField007" select="marc:controlfield[@tag=007]"/>
23                 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
24         <record>
25                         <xsl:if test="$leader"><leader><xsl:value-of select="$leader"/></leader></xsl:if>
26                         <xsl:if test="$controlField001">
27                         <controlfield><xsl:attribute name="tag">001</xsl:attribute><xsl:value-of select="$controlField001"/></controlfield>
28                         </xsl:if>
29                         <xsl:if test="$controlField003">
30             <controlfield><xsl:attribute name="tag">003</xsl:attribute><xsl:value-of select="$controlField003"/></controlfield>
31             </xsl:if>
32                         <xsl:if test="$controlField005">
33             <controlfield><xsl:attribute name="tag">005</xsl:attribute><xsl:value-of select="$controlField005"/></controlfield>
34             </xsl:if>
35                         <xsl:if test="$controlField006">
36             <controlfield><xsl:attribute name="tag">006</xsl:attribute><xsl:value-of select="$controlField006"/></controlfield>
37             </xsl:if>
38                         <xsl:if test="$controlField007">
39             <controlfield><xsl:attribute name="tag">007</xsl:attribute><xsl:value-of select="$controlField007"/></controlfield>
40             </xsl:if>
41                         <xsl:if test="$controlField008">
42             <controlfield><xsl:attribute name="tag">008</xsl:attribute><xsl:value-of select="$controlField008"/></controlfield>
43             </xsl:if>
44
45                         <xsl:for-each select="marc:datafield">
46                                 <xsl:choose>
47                                 <xsl:when test="@tag=952">
48                                 <datafield tag="852" ind1=" " ind2=" ">
49
50                     <xsl:for-each select="marc:subfield[@code='b']">
51                     <subfield><xsl:attribute name="code">b</xsl:attribute>
52                     <xsl:value-of select="."/>
53                     </subfield>
54                     </xsl:for-each>
55
56                     <xsl:for-each select="marc:subfield[@code='p']">
57                     <subfield><xsl:attribute name="code">p</xsl:attribute>
58                     <xsl:value-of select="."/>
59                     </subfield>
60                     </xsl:for-each>
61
62                     <xsl:for-each select="marc:subfield[@code='v']">
63                     <subfield><xsl:attribute name="code">r</xsl:attribute>
64                     <xsl:value-of select="."/>
65                     </subfield>
66                     </xsl:for-each>
67
68                     <xsl:for-each select="marc:subfield[@code='y']">
69                     <subfield><xsl:attribute name="code">w</xsl:attribute>
70                     <xsl:value-of select="."/>
71                     </subfield>
72                     </xsl:for-each>
73
74                     <xsl:for-each select="marc:subfield[@code='z']">
75                     <subfield><xsl:attribute name="code">z</xsl:attribute>
76                     <xsl:value-of select="."/>
77                     </subfield>
78                     </xsl:for-each>
79                                 </datafield>
80                                 </xsl:when>
81                                 <xsl:otherwise>
82                                         <datafield>
83                                         <xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
84                                         <xsl:attribute name="ind1"><xsl:value-of select="@ind1"/></xsl:attribute>
85                                         <xsl:attribute name="ind2"><xsl:value-of select="@ind2"/></xsl:attribute>
86                                                 <xsl:for-each select="marc:subfield">
87                                                 <subfield><xsl:attribute name="code"><xsl:value-of select="@code"/></xsl:attribute><xsl:value-of select="."/></subfield>
88                                                 </xsl:for-each>
89                                         </datafield>
90                                 </xsl:otherwise>
91                                 </xsl:choose>
92                         </xsl:for-each>
93
94         </record>
95         </xsl:template>
96 </xsl:stylesheet>