1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | version="1.0"> |
---|
4 | |
---|
5 | <xsl:output method="xml" indent="yes"/> |
---|
6 | |
---|
7 | <xsl:template match="/wsObjectListQuery"> |
---|
8 | <unimarc> |
---|
9 | <xsl:for-each select="film"> |
---|
10 | <notice> |
---|
11 | <xsl:element name="rs">*</xsl:element> |
---|
12 | <xsl:element name="ru">*</xsl:element> |
---|
13 | <xsl:element name="el">1</xsl:element> |
---|
14 | <xsl:element name="bl">m</xsl:element> |
---|
15 | <xsl:element name="hl">0</xsl:element> |
---|
16 | <xsl:element name="dt">g</xsl:element> |
---|
17 | <xsl:call-template name="cp_pk"/> |
---|
18 | <xsl:call-template name="eresource"/> |
---|
19 | <xsl:for-each select="editorial"> |
---|
20 | <xsl:call-template name="title"/> |
---|
21 | <xsl:call-template name="resume"/> |
---|
22 | <xsl:call-template name="subject"/> |
---|
23 | <xsl:call-template name="cp_genre"/> |
---|
24 | <xsl:call-template name="cp_sub_genre"/> |
---|
25 | </xsl:for-each> |
---|
26 | <xsl:for-each select="technical"> |
---|
27 | <xsl:call-template name="language"/> |
---|
28 | <xsl:call-template name="cp_duration"/> |
---|
29 | <xsl:call-template name="cp_target_audience"/> |
---|
30 | <xsl:call-template name="cp_production_year"/> |
---|
31 | <xsl:call-template name="cp_production_countries"/> |
---|
32 | <xsl:call-template name="cp_codes"/> |
---|
33 | <xsl:call-template name="release_dates"/> |
---|
34 | <xsl:call-template name="cp_copyright"/> |
---|
35 | </xsl:for-each> |
---|
36 | <xsl:for-each select="staff"> |
---|
37 | <xsl:call-template name="responsabilities"/> |
---|
38 | </xsl:for-each> |
---|
39 | <xsl:for-each select="media"> |
---|
40 | <xsl:call-template name="medias"/> |
---|
41 | </xsl:for-each> |
---|
42 | <xsl:for-each select="legal"> |
---|
43 | <xsl:call-template name="cp_allowed_countries"/> |
---|
44 | </xsl:for-each> |
---|
45 | <xsl:call-template name="note_contenu"/> |
---|
46 | <xsl:call-template name="source"/> |
---|
47 | </notice> |
---|
48 | </xsl:for-each> |
---|
49 | </unimarc> |
---|
50 | </xsl:template> |
---|
51 | |
---|
52 | <xsl:template name="language"> |
---|
53 | <xsl:for-each select="languages/language"> |
---|
54 | <f c="101"> |
---|
55 | <s c="c"><xsl:value-of select="@code"/></s> |
---|
56 | </f> |
---|
57 | </xsl:for-each> |
---|
58 | </xsl:template> |
---|
59 | |
---|
60 | <xsl:template name="title"> |
---|
61 | <f c="200"> |
---|
62 | <xsl:for-each select="title"> |
---|
63 | <s c="a"><xsl:value-of select="."/></s> |
---|
64 | </xsl:for-each> |
---|
65 | <xsl:for-each select="editorial/original_title"> |
---|
66 | <s c="d"><xsl:value-of select="."/></s> |
---|
67 | </xsl:for-each> |
---|
68 | </f> |
---|
69 | </xsl:template> |
---|
70 | |
---|
71 | <xsl:template name="note_contenu"> |
---|
72 | <f c="327"> |
---|
73 | <s c="a"><xsl:text>Vidéo à la demande</xsl:text></s> |
---|
74 | </f> |
---|
75 | </xsl:template> |
---|
76 | |
---|
77 | <xsl:template name="resume"> |
---|
78 | <xsl:if test="description"> |
---|
79 | <f c="330"> |
---|
80 | <s c="a"> |
---|
81 | <xsl:for-each select="description"> |
---|
82 | <xsl:value-of select="."/> |
---|
83 | </xsl:for-each> |
---|
84 | <xsl:if test="body"> |
---|
85 | <xsl:text> </xsl:text> |
---|
86 | <xsl:for-each select="body"> |
---|
87 | <xsl:value-of select="."/> |
---|
88 | </xsl:for-each> |
---|
89 | </xsl:if> |
---|
90 | </s> |
---|
91 | </f> |
---|
92 | </xsl:if> |
---|
93 | </xsl:template> |
---|
94 | |
---|
95 | <xsl:template name="subject"> |
---|
96 | <xsl:if test="tags/tag!=''"> |
---|
97 | <xsl:for-each select="tags/tag/label"> |
---|
98 | <f c="610"> |
---|
99 | <s c="a"><xsl:value-of select="."></xsl:value-of></s> |
---|
100 | </f> |
---|
101 | </xsl:for-each> |
---|
102 | </xsl:if> |
---|
103 | </xsl:template> |
---|
104 | |
---|
105 | <xsl:template name="responsabilities"> |
---|
106 | <xsl:if test="authors/person"> |
---|
107 | <xsl:for-each select="authors/person"> |
---|
108 | <xsl:choose> |
---|
109 | <xsl:when test="position()=1"> |
---|
110 | <f c="700"> |
---|
111 | <s c="a"><xsl:value-of select="last_name"/></s> |
---|
112 | <s c="b"><xsl:value-of select="first_name"/></s> |
---|
113 | <s c="4">070</s> |
---|
114 | </f> |
---|
115 | </xsl:when> |
---|
116 | <xsl:otherwise> |
---|
117 | <f c="701"> |
---|
118 | <s c="a"><xsl:value-of select="last_name"/></s> |
---|
119 | <s c="b"><xsl:value-of select="first_name"/></s> |
---|
120 | <s c="4">070</s> |
---|
121 | </f> |
---|
122 | </xsl:otherwise> |
---|
123 | </xsl:choose> |
---|
124 | </xsl:for-each> |
---|
125 | </xsl:if> |
---|
126 | <xsl:if test="actors/person"> |
---|
127 | <xsl:for-each select="actors/person"> |
---|
128 | <f c="702"> |
---|
129 | <s c="a"><xsl:value-of select="last_name"/></s> |
---|
130 | <s c="b"><xsl:value-of select="first_name"/></s> |
---|
131 | <s c="4">005</s> |
---|
132 | </f> |
---|
133 | </xsl:for-each> |
---|
134 | </xsl:if> |
---|
135 | </xsl:template> |
---|
136 | |
---|
137 | <xsl:template name="eresource"> |
---|
138 | <xsl:if test="externalUri"> |
---|
139 | <xsl:for-each select="externalUri"> |
---|
140 | <f c="856"> |
---|
141 | <s c="u"><xsl:value-of select="."/></s> |
---|
142 | </f> |
---|
143 | </xsl:for-each> |
---|
144 | </xsl:if> |
---|
145 | </xsl:template> |
---|
146 | |
---|
147 | <xsl:template name="release_dates"> |
---|
148 | <xsl:if test="release_dates/release_date"> |
---|
149 | <f c="300"> |
---|
150 | <s c="a"> |
---|
151 | <xsl:for-each select="release_dates/release_date"> |
---|
152 | <xsl:variable name="releaseDate"><xsl:value-of select="."/></xsl:variable> |
---|
153 | <xsl:choose> |
---|
154 | <xsl:when test="@code='CINE'"> |
---|
155 | <xsl:text>Sortie au cinéma le : </xsl:text> |
---|
156 | <xsl:value-of select="concat(substring($releaseDate, 9, 2), '/', substring($releaseDate, 6, 2), '/', substring($releaseDate,1,4))"/> |
---|
157 | <xsl:text>.</xsl:text> |
---|
158 | </xsl:when> |
---|
159 | <xsl:when test="@code='VOD'"> |
---|
160 | <xsl:text>Sortie en VOD le : </xsl:text> |
---|
161 | <xsl:value-of select="concat(substring($releaseDate, 9, 2), '/', substring($releaseDate, 6, 2), '/', substring($releaseDate,1,4))"/> |
---|
162 | <xsl:text>.</xsl:text> |
---|
163 | </xsl:when> |
---|
164 | <xsl:when test="@code='DVD'"> |
---|
165 | <xsl:text>Sortie en DVD le : </xsl:text> |
---|
166 | <xsl:value-of select="concat(substring($releaseDate, 9, 2), '/', substring($releaseDate, 6, 2), '/', substring($releaseDate,1,4))"/> |
---|
167 | <xsl:text>.</xsl:text> |
---|
168 | </xsl:when> |
---|
169 | <xsl:otherwise> |
---|
170 | <xsl:value-of select="concat(substring($releaseDate, 9, 2), '/', substring($releaseDate, 6, 2), '/', substring($releaseDate,1,4))"/> |
---|
171 | <xsl:text>.</xsl:text> |
---|
172 | </xsl:otherwise> |
---|
173 | </xsl:choose> |
---|
174 | </xsl:for-each> |
---|
175 | </s> |
---|
176 | </f> |
---|
177 | </xsl:if> |
---|
178 | </xsl:template> |
---|
179 | |
---|
180 | <xsl:template name="medias"> |
---|
181 | <xsl:if test="posters/media"> |
---|
182 | <xsl:for-each select="posters/media"> |
---|
183 | <f c="897"> |
---|
184 | <s c="a"><xsl:value-of select="@src"/></s> |
---|
185 | <s c="b"><xsl:value-of select="."/></s> |
---|
186 | </f> |
---|
187 | </xsl:for-each> |
---|
188 | </xsl:if> |
---|
189 | <xsl:if test="trailers/media"> |
---|
190 | <xsl:for-each select="trailers/media"> |
---|
191 | <f c="897"> |
---|
192 | <s c="a"><xsl:value-of select="@src"/></s> |
---|
193 | <s c="b"><xsl:value-of select="."/></s> |
---|
194 | </f> |
---|
195 | </xsl:for-each> |
---|
196 | </xsl:if> |
---|
197 | <xsl:if test="photos/media"> |
---|
198 | <xsl:for-each select="photos/media"> |
---|
199 | <f c="897"> |
---|
200 | <s c="a"><xsl:value-of select="@src"/></s> |
---|
201 | <s c="b"><xsl:value-of select="."/></s> |
---|
202 | </f> |
---|
203 | </xsl:for-each> |
---|
204 | </xsl:if> |
---|
205 | </xsl:template> |
---|
206 | |
---|
207 | <xsl:template name="cp_genre"> |
---|
208 | <xsl:if test="genre"> |
---|
209 | <xsl:for-each select="genre"> |
---|
210 | <f c="900"> |
---|
211 | <s c="a"><xsl:value-of select="."/></s> |
---|
212 | <s c="l">Genre of a film.</s> |
---|
213 | <s c="n">cp_genre</s> |
---|
214 | </f> |
---|
215 | </xsl:for-each> |
---|
216 | </xsl:if> |
---|
217 | </xsl:template> |
---|
218 | |
---|
219 | <xsl:template name="cp_sub_genre"> |
---|
220 | <xsl:if test="sub_genre"> |
---|
221 | <xsl:for-each select="sub_genre"> |
---|
222 | <f c="900"> |
---|
223 | <s c="a"><xsl:value-of select="."/></s> |
---|
224 | <s c="n">cp_sub_genre</s> |
---|
225 | </f> |
---|
226 | </xsl:for-each> |
---|
227 | </xsl:if> |
---|
228 | </xsl:template> |
---|
229 | |
---|
230 | <xsl:template name="cp_duration"> |
---|
231 | <xsl:if test="duration"> |
---|
232 | <xsl:for-each select="duration"> |
---|
233 | <f c="900"> |
---|
234 | <s c="a"><xsl:value-of select="."/></s> |
---|
235 | <s c="n">cp_duration</s> |
---|
236 | </f> |
---|
237 | </xsl:for-each> |
---|
238 | </xsl:if> |
---|
239 | </xsl:template> |
---|
240 | |
---|
241 | <xsl:template name="cp_target_audience"> |
---|
242 | <xsl:if test="target_audience"> |
---|
243 | <xsl:for-each select="target_audience"> |
---|
244 | <f c="900"> |
---|
245 | <s c="a"><xsl:value-of select="."/></s> |
---|
246 | <s c="n">cp_target_audience</s> |
---|
247 | </f> |
---|
248 | </xsl:for-each> |
---|
249 | </xsl:if> |
---|
250 | </xsl:template> |
---|
251 | |
---|
252 | <xsl:template name="cp_production_year"> |
---|
253 | <xsl:if test="production_year"> |
---|
254 | <xsl:for-each select="production_year"> |
---|
255 | <f c="900"> |
---|
256 | <s c="a"><xsl:value-of select="."/></s> |
---|
257 | <s c="n">cp_production_year</s> |
---|
258 | </f> |
---|
259 | </xsl:for-each> |
---|
260 | </xsl:if> |
---|
261 | </xsl:template> |
---|
262 | |
---|
263 | <xsl:template name="cp_production_countries"> |
---|
264 | <xsl:if test="production_countries/country"> |
---|
265 | <xsl:for-each select="production_countries/country"> |
---|
266 | <f c="900"> |
---|
267 | <s c="a"><xsl:value-of select="@code"/></s> |
---|
268 | <s c="n">cp_production_countries</s> |
---|
269 | </f> |
---|
270 | </xsl:for-each> |
---|
271 | </xsl:if> |
---|
272 | </xsl:template> |
---|
273 | |
---|
274 | <xsl:template name="cp_codes"> |
---|
275 | <xsl:if test="codes/code"> |
---|
276 | <xsl:for-each select="codes/code"> |
---|
277 | <f c="900"> |
---|
278 | <s c="a"><xsl:value-of select="."/></s> |
---|
279 | <s c="l">Define code type.</s> |
---|
280 | <s c="n">cp_codes</s> |
---|
281 | </f> |
---|
282 | </xsl:for-each> |
---|
283 | </xsl:if> |
---|
284 | </xsl:template> |
---|
285 | |
---|
286 | <xsl:template name="cp_copyright"> |
---|
287 | <xsl:if test="copyright"> |
---|
288 | <xsl:for-each select="copyright"> |
---|
289 | <f c="900"> |
---|
290 | <s c="a"><xsl:value-of select="."/></s> |
---|
291 | <s c="l">Film Copyright.</s> |
---|
292 | <s c="n">cp_copyright</s> |
---|
293 | </f> |
---|
294 | </xsl:for-each> |
---|
295 | </xsl:if> |
---|
296 | </xsl:template> |
---|
297 | |
---|
298 | <xsl:template name="cp_allowed_countries"> |
---|
299 | <xsl:if test="allowed_countries/country"> |
---|
300 | <xsl:for-each select="allowed_countries/country"> |
---|
301 | <f c="900"> |
---|
302 | <s c="a"><xsl:value-of select="@code"/></s> |
---|
303 | <s c="n">cp_allowed_countries</s> |
---|
304 | </f> |
---|
305 | </xsl:for-each> |
---|
306 | </xsl:if> |
---|
307 | </xsl:template> |
---|
308 | |
---|
309 | <xsl:template name="cp_pk"> |
---|
310 | <xsl:if test="pk"> |
---|
311 | <xsl:for-each select="pk"> |
---|
312 | <f c="900"> |
---|
313 | <s c="a"><xsl:value-of select="."/></s> |
---|
314 | <s c="l">Film unique ID.</s> |
---|
315 | <s c="n">cp_pk</s> |
---|
316 | </f> |
---|
317 | </xsl:for-each> |
---|
318 | </xsl:if> |
---|
319 | </xsl:template> |
---|
320 | |
---|
321 | <xsl:template name="source"> |
---|
322 | <f c="801"> |
---|
323 | <s c="a">FR</s> |
---|
324 | <s c="b">ArteVOD</s> |
---|
325 | </f> |
---|
326 | </xsl:template> |
---|
327 | </xsl:stylesheet> |
---|