Pazpar2 1.4.4-2 for squeeze
[pazpar2-moved-to-github.git] / etc / cf.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     This stylesheet expects Connector Frameworks records
4 -->
5 <xsl:stylesheet
6     version="1.0"
7     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8     xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
9     xmlns:dc="http://purl.org/dc/elements/1.1/"
10     xmlns:siebel="http://loc.gov/siebel/elements/1.0/" >
11
12  <xsl:output indent="yes"
13         method="xml"
14         version="1.0"
15         encoding="UTF-8"/>
16
17   <xsl:template match="/record">
18     <pz:record>
19       <xsl:apply-templates/>
20     </pz:record>
21   </xsl:template>
22
23   <!--
24       The elements mapped in the following clauses should be kept more
25       or less in sync with those named in builder/templates/search.cft
26       in the "cf" git module.
27   -->
28
29   <xsl:template match="date">
30     <pz:metadata type="publication-date">
31       <xsl:value-of select="."/>
32     </pz:metadata>
33     <pz:metadata type="date">
34       <xsl:value-of select="."/>
35     </pz:metadata>
36   </xsl:template>
37
38   <xsl:template match="url">
39     <pz:metadata type="electronic-url">
40       <xsl:value-of select="."/>
41     </pz:metadata>
42   </xsl:template>
43
44   <xsl:template match="title">
45     <pz:metadata type="title">
46       <xsl:value-of select="."/>
47     </pz:metadata>
48     <pz:metadata type="title-complete">
49       <xsl:value-of select="." />
50     </pz:metadata>
51   </xsl:template>
52
53   <xsl:template match="author">
54     <pz:metadata type="author">
55       <xsl:value-of select="."/>
56     </pz:metadata>
57   </xsl:template>
58
59   <xsl:template match="description">
60     <pz:metadata type="description">
61       <xsl:value-of select="."/>
62     </pz:metadata>
63   </xsl:template>
64   
65   <xsl:template match="publisher">
66     <pz:metadata type="publisher">
67       <xsl:value-of select="."/>
68     </pz:metadata>
69   </xsl:template>
70
71   <xsl:template match="subject">
72     <pz:metadata type="subject">
73       <xsl:value-of select="."/>
74     </pz:metadata>
75   </xsl:template>
76
77   <xsl:template match="item">
78     <pz:metadata type="locallocation">
79       <xsl:choose>
80         <xsl:when test="string-length(location)">
81           <xsl:value-of select="location"/>
82         </xsl:when>
83         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
84       </xsl:choose>
85     </pz:metadata>
86     <pz:metadata type="callnumber">
87       <xsl:choose>
88         <xsl:when test="string-length(callno)">
89           <xsl:value-of select="callno"/>
90         </xsl:when>
91         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
92       </xsl:choose>
93     </pz:metadata>
94     <pz:metadata type="available">
95       <xsl:choose>
96         <xsl:when test="string-length(available)">
97           <xsl:value-of select="available"/>
98         </xsl:when>
99         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
100       </xsl:choose>
101     </pz:metadata>
102     <pz:metadata type="publicnote">
103       <xsl:choose>
104         <xsl:when test="string-length(publicnote)">
105           <xsl:value-of select="publicnote"/>
106         </xsl:when>
107         <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
108       </xsl:choose>
109     </pz:metadata>
110   </xsl:template>
111
112   <xsl:template match="due">
113     <pz:metadata type="due">
114       <xsl:value-of select="."/>
115     </pz:metadata>
116   </xsl:template>
117
118   <xsl:template match="location">
119     <pz:metadata type="locallocation">
120       <xsl:value-of select="."/>
121     </pz:metadata>
122   </xsl:template>
123
124   <xsl:template match="callno">
125     <pz:metadata type="callnumber">
126       <xsl:value-of select="."/>
127     </pz:metadata>
128   </xsl:template>
129
130   <xsl:template match="thumburl">
131     <pz:metadata type="thumburl">
132       <xsl:value-of select="."/>
133     </pz:metadata>
134   </xsl:template>
135
136   <xsl:template match="score">
137     <pz:metadata type="score">
138       <xsl:value-of select="."/>
139     </pz:metadata>
140   </xsl:template>
141
142   <xsl:template match="text()"/>
143
144 </xsl:stylesheet>