Remove unmaintained tests
[pazpar2-moved-to-github.git] / etc / unimarc.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet
3     version="1.0"
4     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5     xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
6     xmlns:marc="http://www.loc.gov/MARC21/slim">
7
8  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
9
10
11   <xsl:template match="/marc:record">
12     <pz:record>
13
14       <xsl:for-each select="marc:controlfield[@tag='001']">
15         <pz:metadata type="id">
16           <xsl:value-of select="."/>
17         </pz:metadata>
18       </xsl:for-each>
19
20       <!-- -->
21       <xsl:for-each select="marc:datafield[@tag='020']">
22         <xsl:if test="marc:subfield[@code='a'] = 'US'">
23           <pz:metadata type="lccn">
24             <xsl:value-of select="marc:subfield[@code='b']"/>
25           </pz:metadata>
26         </xsl:if>
27       </xsl:for-each>
28
29       <xsl:for-each select="marc:datafield[@tag='010']">
30         <pz:metadata type="isbn">
31           <xsl:value-of select="marc:subfield[@code='a']"/>
32         </pz:metadata>
33       </xsl:for-each>
34
35       <xsl:for-each select="marc:datafield[@tag='011']">
36         <pz:metadata type="issn">
37           <xsl:value-of select="marc:subfield[@code='a']"/>
38         </pz:metadata>
39       </xsl:for-each>
40
41
42       <xsl:for-each select="marc:datafield[@tag='200']">
43         <pz:metadata type="title">
44           <xsl:value-of select="marc:subfield[@code='a']"/>
45         </pz:metadata>
46       </xsl:for-each>
47
48
49       <!-- Date of Pulbication -->
50       <xsl:for-each select="marc:datafield[@tag='210']">
51         <pz:metadata type="date">
52           <xsl:value-of select="marc:subfield[@code='d']"/>
53         </pz:metadata>
54       </xsl:for-each>
55
56       <!--  Usmarc 650 maps to unimarc 606 and marc21 653 maps to unimarc 610 -->
57       <xsl:for-each select="marc:datafield[@tag='606' or @tag='610']">
58         <pz:metadata type="subject">
59           <xsl:value-of select="marc:subfield[@code='a']"/>
60         </pz:metadata>
61       </xsl:for-each>
62
63       <xsl:for-each select="marc:datafield[@tag &gt;= 300 and @tag &lt;= 345]
64                             [@tag != '325']">
65         <pz:metadata type="description">
66             <xsl:value-of select="*/text()"/>
67         </pz:metadata>
68       </xsl:for-each>
69
70
71       <!-- Author : primary, alternative and secondary responsibility (equivalent marc21 tags : 100, 700 -->
72       <xsl:for-each select="marc:datafield[@tag='700' or @tag='701' or @tag='702']">
73         <pz:metadata type="author">
74           <xsl:value-of select="marc:subfield[@code='a']"/>
75           <xsl:text>, </xsl:text>
76           <xsl:value-of select="marc:subfield[@code='b']"/>
77         </pz:metadata>
78       </xsl:for-each>
79
80       <!-- Author : marc21 tag 720 maps to unimarc 730
81       <xsl:for-each select="marc:datafield[@tag='730']">
82         <pz:metadata type="author">
83           <xsl:value-of select="marc:subfield[@code='a']"/>
84         </pz:metadata>
85       </xsl:for-each>
86       -->
87
88       <!-- -->
89       <xsl:for-each select="marc:datafield[@tag='856']">
90         <pz:metadata type="url">
91           <xsl:value-of select="marc:subfield[@code='u']"/>
92         </pz:metadata>
93       </xsl:for-each>
94
95     </pz:record>
96   </xsl:template>
97
98 </xsl:stylesheet>