svn-gvsig-desktop / tags / v1_9_Build_1242 / extensions / extMetadata / xslt / ISO_DC.xsl @ 38629
History | View | Annotate | Download (28.7 KB)
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
---|---|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
3 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
4 |
xmlns:dcterms="http://purl.org/dc/terms/" |
5 |
xmlns:iso19115="http://www.isotc211.org/iso19115" |
6 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="iso19115"> |
7 |
|
8 |
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/> |
9 |
<!-- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
10 |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"--> |
11 |
|
12 |
<!--xsl:output doctype-system="U:/projects/s65_SERGIS/s6542_GIDC/Hojas de estilo/ISO-DC/DCMES.dtd"/--> |
13 |
<!-- this line will change if the location of the DTD changes. --> |
14 |
|
15 |
<!-- Stylesheet that translates a correct ISO data into a correct DC data --> |
16 |
<!-- Author: mapi IAAA --> |
17 |
<!-- noviembre 2003: se modifica para que sea acorde a la ultima versi?n --> |
18 |
<!-- del ISO19115 --> |
19 |
<!-- [jnog 5/2/2004] eliminar uso de namespace iso19115: . |
20 |
[jnog 6/2/2004] Tratar nombres de clases, language |
21 |
[carlose 30/11/2004] se a?ade el atributo namespace al xsl:if de tratamiento del language para que procese bien el language --> |
22 |
|
23 |
<!--xsl:strip-space elements="dc"/--> |
24 |
|
25 |
<xsl:template match="/"> |
26 |
<xsl:apply-templates select="MD_Metadata"/> |
27 |
</xsl:template> |
28 |
|
29 |
<xsl:template match="MD_Metadata"> |
30 |
|
31 |
<xsl:variable name="xsltsl-str-lower" select="'a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z'"/> |
32 |
<xsl:variable name="xsltsl-str-upper" select="'A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z'"/> |
33 |
|
34 |
<!--xsl:element name="qualifieddc"--> |
35 |
<qualifieddc> |
36 |
<xsl:if test="./fileIdentifier"> |
37 |
<xsl:attribute name="fileID"> |
38 |
<xsl:value-of select="./fileIdentifier"/> |
39 |
</xsl:attribute> |
40 |
</xsl:if> |
41 |
|
42 |
<xsl:if test="./language"> |
43 |
<xsl:attribute name="xml:lang" namespace="http://www.w3.org/XML/1998/namespace"> |
44 |
<xsl:choose> |
45 |
<xsl:when test="./language/*='SPANISH' or ./language/*='ESPA?OL' or ./language/*='ESPANYOL'"> |
46 |
<xsl:text>es</xsl:text> |
47 |
</xsl:when> |
48 |
<xsl:when test="./language/*='ENGLISH' or ./language/*='INGL?S' or ./language/*='ANGL?S'"> |
49 |
<xsl:text>en</xsl:text> |
50 |
</xsl:when> |
51 |
<xsl:when test="./language/*='CATALAN' or ./language/*='CATAL?N' or ./language/*='CATAL?'"> |
52 |
<xsl:text>ca</xsl:text> |
53 |
</xsl:when> |
54 |
<xsl:otherwise> |
55 |
<xsl:value-of select="./language"/> |
56 |
</xsl:otherwise> |
57 |
</xsl:choose> |
58 |
</xsl:attribute> |
59 |
</xsl:if> |
60 |
|
61 |
<!-- Element title conversion: --> |
62 |
<!-- It's supposed to be more than one ocurrence in ISO (and that --> |
63 |
<!-- means more than citation element). For each ocurrence of --> |
64 |
<!-- citation.title a new element dc:title will be generated --> |
65 |
|
66 |
<!-- ISO CORE and ISO COMPREHENSIVE--> |
67 |
<xsl:for-each select="./identificationInfo/*/citation/*/title"> |
68 |
<xsl:element name="dc:title"> |
69 |
<xsl:value-of select="normalize-space(.)"/> |
70 |
</xsl:element> |
71 |
</xsl:for-each> |
72 |
|
73 |
<!-- Also a new element dc:title is generated for each --> |
74 |
<!--citation.alternateTitle element --> |
75 |
|
76 |
<xsl:for-each select="./identificationInfo/*/citation/*/alternateTitle"> |
77 |
<xsl:element name="dc:title"> |
78 |
<xsl:value-of select="normalize-space(.)"/> |
79 |
</xsl:element> |
80 |
</xsl:for-each> |
81 |
|
82 |
|
83 |
<!-- creator element conversion: --> |
84 |
<!-- It's assumed that at least, one of organisationName, individualName --> |
85 |
<!-- or positionName exists. No comprobations are made. --> |
86 |
<!-- ISO COMPREHENSIVE --> |
87 |
<xsl:for-each select="./identificationInfo/*/citation/*/citedResponsibleParty/CI_ResponsibleParty"> |
88 |
<xsl:if test="normalize-space(./role)='originator'"> |
89 |
<xsl:element name="dc:creator"> |
90 |
<xsl:choose> |
91 |
<xsl:when test="./organisationName"> |
92 |
<xsl:value-of select="./organisationName"/> |
93 |
</xsl:when> |
94 |
<xsl:when test="./individualName"> |
95 |
<xsl:value-of select="./individualName"/> |
96 |
</xsl:when> |
97 |
<xsl:when test="./positionName"> |
98 |
<xsl:value-of select="./positionName"/> |
99 |
</xsl:when> |
100 |
<xsl:otherwise> |
101 |
<!-- Nothing. This should never happen. --> |
102 |
</xsl:otherwise> |
103 |
</xsl:choose> |
104 |
</xsl:element> |
105 |
</xsl:if> |
106 |
</xsl:for-each> |
107 |
|
108 |
<!-- ISO CORE --> |
109 |
<xsl:for-each select="./identificationInfo/*/pointOfContact/CI_ResponsibleParty"> |
110 |
<xsl:if test="normalize-space(./role)='originator'"> |
111 |
<xsl:element name="dc:creator"> |
112 |
<xsl:choose> |
113 |
<xsl:when test="./organisationName"> |
114 |
<xsl:value-of select="./organisationName"/> |
115 |
</xsl:when> |
116 |
<xsl:when test="./individualName"> |
117 |
<xsl:value-of select="./individualName"/> |
118 |
</xsl:when> |
119 |
<xsl:when test="./positionName"> |
120 |
<xsl:value-of select="./positionName"/> |
121 |
</xsl:when> |
122 |
<xsl:otherwise> |
123 |
<!-- Nothing. This should be never happen. --> |
124 |
</xsl:otherwise> |
125 |
</xsl:choose> |
126 |
</xsl:element> |
127 |
</xsl:if> |
128 |
</xsl:for-each> |
129 |
|
130 |
<!-- Element subject conversion --> |
131 |
<!-- The data is supposed to be correct and for this reason the --> |
132 |
<!-- verification of the correction of the value is not made. --> |
133 |
<!-- ISO COMPREHENSIVE --> |
134 |
|
135 |
<xsl:for-each select="./identificationInfo/*/descriptiveKeywords/MD_Keywords"> |
136 |
<xsl:if test="normalize-space(./type)='theme'"> |
137 |
<xsl:element name="dc:subject"> |
138 |
<xsl:value-of select="./keyword"/> |
139 |
</xsl:element> |
140 |
</xsl:if> |
141 |
</xsl:for-each> |
142 |
|
143 |
<!-- ISO CORE --> |
144 |
<xsl:for-each select="./identificationInfo/*/topicCategory"> |
145 |
<xsl:element name="dc:subject"> |
146 |
<xsl:value-of select="normalize-space(.)"/> |
147 |
</xsl:element> |
148 |
</xsl:for-each> |
149 |
|
150 |
|
151 |
<!-- description element conversion --> |
152 |
<!-- For each ocurrence of abstract a new dc:description will be --> |
153 |
<!-- generated --> |
154 |
<!-- ISO CORE E ISO COMPREHENSIVE--> |
155 |
<xsl:for-each select="./identificationInfo/*/abstract"> |
156 |
<xsl:element name="dc:description"> |
157 |
<xsl:value-of select="."/> |
158 |
</xsl:element> |
159 |
</xsl:for-each> |
160 |
|
161 |
<!-- publisher element conversion: --> |
162 |
<!-- It's assumed that at least, one of organisationName, individualName --> |
163 |
<!-- or positionName exists. No comprobations are made. --> |
164 |
|
165 |
<!-- ISO COMPREHENSIVE --> |
166 |
<xsl:for-each select="./identificationInfo/*/citation/*/citedResponsibleParty/CI_ResponsibleParty"> |
167 |
<xsl:if test="normalize-space(./role)='publisher'"> |
168 |
<xsl:element name="dc:publisher"> |
169 |
<xsl:choose> |
170 |
<xsl:when test="./organisationName"> |
171 |
<xsl:value-of select="./organisationName"/> |
172 |
</xsl:when> |
173 |
<xsl:when test="./individualName"> |
174 |
<xsl:value-of select="./individualName"/> |
175 |
</xsl:when> |
176 |
<xsl:when test="./positionName"> |
177 |
<xsl:value-of select="./positionName"/> |
178 |
</xsl:when> |
179 |
<xsl:otherwise> |
180 |
<!-- Nothing. This should be never happen. --> |
181 |
</xsl:otherwise> |
182 |
</xsl:choose> |
183 |
</xsl:element> |
184 |
</xsl:if> |
185 |
</xsl:for-each> |
186 |
|
187 |
<xsl:for-each select="./identificationInfo/*/pointOfContact/CI_ResponsibleParty"> |
188 |
<xsl:if test="normalize-space(./role)='publisher'"> |
189 |
<xsl:element name="dc:publisher"> |
190 |
<xsl:choose> |
191 |
<xsl:when test="./organisationName"> |
192 |
<xsl:value-of select="./organisationName"/> |
193 |
</xsl:when> |
194 |
<xsl:when test="./individualName"> |
195 |
<xsl:value-of select="./individualName"/> |
196 |
</xsl:when> |
197 |
<xsl:when test="./positionName"> |
198 |
<xsl:value-of select="./positionName"/> |
199 |
</xsl:when> |
200 |
<xsl:otherwise> |
201 |
<!-- Nothing. This should be never happen. --> |
202 |
</xsl:otherwise> |
203 |
</xsl:choose> |
204 |
</xsl:element> |
205 |
</xsl:if> |
206 |
</xsl:for-each> |
207 |
|
208 |
<!-- ISO CORE --> |
209 |
<xsl:for-each select="./contact/CI_ResponsibleParty"> |
210 |
<xsl:if test="normalize-space(./role)='publisher'"> |
211 |
<xsl:element name="dc:publisher"> |
212 |
<xsl:choose> |
213 |
<xsl:when test="./organisationName"> |
214 |
<xsl:value-of select="./organisationName"/> |
215 |
</xsl:when> |
216 |
<xsl:when test="./individualName"> |
217 |
<xsl:value-of select="./individualName"/> |
218 |
</xsl:when> |
219 |
<xsl:when test="./positionName"> |
220 |
<xsl:value-of select="./positionName"/> |
221 |
</xsl:when> |
222 |
<xsl:otherwise> |
223 |
<!-- Nothing. This should be never happen. --> |
224 |
</xsl:otherwise> |
225 |
</xsl:choose> |
226 |
</xsl:element> |
227 |
</xsl:if> |
228 |
</xsl:for-each> |
229 |
|
230 |
|
231 |
<!-- contributor element conversion --> |
232 |
<!-- ISO COMPREHENSIVE --> |
233 |
<xsl:for-each select="./identificationInfo/*/credit"> |
234 |
<xsl:element name="dc:contributor"> |
235 |
<xsl:value-of select="."/> |
236 |
</xsl:element> |
237 |
</xsl:for-each> |
238 |
|
239 |
|
240 |
<!-- ISO CORE N/A ???GAP!!! --> |
241 |
|
242 |
<!-- date element conversion: In ISO the publication date is compulsory --> |
243 |
<!-- and it can appear N times --> |
244 |
<!-- ISO CORE E ISO COMPREHENSIVE--> |
245 |
<xsl:for-each select="./identificationInfo/*/citation/*/date"> |
246 |
<xsl:if test="normalize-space(./*/dateType)='publication'"> |
247 |
<xsl:element name="dc:date"> |
248 |
<xsl:value-of select="./*/date"/> |
249 |
</xsl:element> |
250 |
</xsl:if> |
251 |
</xsl:for-each> |
252 |
|
253 |
<!-- Another publication date will be generated with the value of --> |
254 |
<!-- dateStamp. --> |
255 |
|
256 |
<xsl:if test="./dateStamp"> |
257 |
<xsl:element name="dc:date"> |
258 |
<xsl:value-of select="./dateStamp"/> |
259 |
</xsl:element> |
260 |
</xsl:if> |
261 |
|
262 |
|
263 |
<!-- element type conversion(1) --> |
264 |
<!-- ISO COMPREHENSIVE --> |
265 |
<xsl:for-each select="./hierarchyLevel"> |
266 |
<xsl:variable name="hierarchyLevelVar"> |
267 |
<!-- it's translated to lower case --> |
268 |
<xsl:value-of select="translate(normalize-space(.),$xsltsl-str-upper, $xsltsl-str-lower)"/> |
269 |
</xsl:variable> |
270 |
|
271 |
<xsl:choose> |
272 |
<xsl:when test="$hierarchyLevelVar='attribute'"> |
273 |
<xsl:element name="dc:type"> |
274 |
<xsl:value-of select="normalize-space(.)"/> |
275 |
</xsl:element> |
276 |
<xsl:element name="dc:type"> |
277 |
<xsl:text>Dataset</xsl:text> |
278 |
</xsl:element> |
279 |
</xsl:when> |
280 |
|
281 |
<xsl:when test="$hierarchyLevelVar='attributetype'"> |
282 |
<xsl:element name="dc:type"> |
283 |
<xsl:value-of select="normalize-space(.)"/> |
284 |
</xsl:element> |
285 |
<xsl:element name="dc:type"> |
286 |
<xsl:text>Dataset</xsl:text> |
287 |
</xsl:element> |
288 |
</xsl:when> |
289 |
|
290 |
<xsl:when test="$hierarchyLevelVar='collectionhardware'"> |
291 |
<xsl:element name="dc:type"> |
292 |
<xsl:value-of select="normalize-space(.)"/> |
293 |
</xsl:element> |
294 |
<xsl:element name="dc:type"> |
295 |
<xsl:text>Dataset</xsl:text> |
296 |
</xsl:element> |
297 |
</xsl:when> |
298 |
|
299 |
<xsl:when test="$hierarchyLevelVar='collectionsession'"> |
300 |
<xsl:element name="dc:type"> |
301 |
<xsl:value-of select="normalize-space(.)"/> |
302 |
</xsl:element> |
303 |
<xsl:element name="dc:type"> |
304 |
<xsl:text>Event</xsl:text> |
305 |
</xsl:element> |
306 |
</xsl:when> |
307 |
|
308 |
<xsl:when test="$hierarchyLevelVar='dataset'"> |
309 |
<!-- If upper and lower cases are the same, only one dataset must --> |
310 |
<!-- be generated --> |
311 |
<xsl:element name="dc:type"> |
312 |
<xsl:value-of select="normalize-space(.)"/> |
313 |
</xsl:element> |
314 |
<!--xsl:element name="dc:type"> |
315 |
<xsl:text>Dataset</xsl:text> |
316 |
</xsl:element--> |
317 |
</xsl:when> |
318 |
|
319 |
<xsl:when test="$hierarchyLevelVar='series'"> |
320 |
<xsl:element name="dc:type"> |
321 |
<xsl:value-of select="normalize-space(.)"/> |
322 |
</xsl:element> |
323 |
<xsl:element name="dc:type"> |
324 |
<xsl:text>Collection</xsl:text> |
325 |
</xsl:element> |
326 |
</xsl:when> |
327 |
|
328 |
<xsl:when test="$hierarchyLevelVar='nongeographicdataset'"> |
329 |
<xsl:element name="dc:type"> |
330 |
<xsl:value-of select="normalize-space(.)"/> |
331 |
</xsl:element> |
332 |
<xsl:element name="dc:type"> |
333 |
<xsl:text>Dataset</xsl:text> |
334 |
</xsl:element> |
335 |
</xsl:when> |
336 |
|
337 |
<xsl:when test="$hierarchyLevelVar='dimensiongroup'"> |
338 |
<xsl:element name="dc:type"> |
339 |
<xsl:value-of select="normalize-space(.)"/> |
340 |
</xsl:element> |
341 |
<xsl:element name="dc:type"> |
342 |
<xsl:text>Dataset</xsl:text> |
343 |
</xsl:element> |
344 |
</xsl:when> |
345 |
|
346 |
<xsl:when test="$hierarchyLevelVar='feature'"> |
347 |
<xsl:element name="dc:type"> |
348 |
<xsl:value-of select="normalize-space(.)"/> |
349 |
</xsl:element> |
350 |
<xsl:element name="dc:type"> |
351 |
<xsl:text>Dataset</xsl:text> |
352 |
</xsl:element> |
353 |
</xsl:when> |
354 |
|
355 |
<xsl:when test="$hierarchyLevelVar='featuretype'"> |
356 |
<xsl:element name="dc:type"> |
357 |
<xsl:value-of select="normalize-space(.)"/> |
358 |
</xsl:element> |
359 |
<xsl:element name="dc:type"> |
360 |
<xsl:text>Dataset</xsl:text> |
361 |
</xsl:element> |
362 |
</xsl:when> |
363 |
|
364 |
<xsl:when test="$hierarchyLevelVar='propertytype'"> |
365 |
<xsl:element name="dc:type"> |
366 |
<xsl:value-of select="normalize-space(.)"/> |
367 |
</xsl:element> |
368 |
<xsl:element name="dc:type"> |
369 |
<xsl:text>Dataset</xsl:text> |
370 |
</xsl:element> |
371 |
</xsl:when> |
372 |
|
373 |
<xsl:when test="$hierarchyLevelVar='fieldsession'"> |
374 |
<xsl:element name="dc:type"> |
375 |
<xsl:value-of select="normalize-space(.)"/> |
376 |
</xsl:element> |
377 |
<xsl:element name="dc:type"> |
378 |
<xsl:text>Event</xsl:text> |
379 |
</xsl:element> |
380 |
</xsl:when> |
381 |
|
382 |
<xsl:when test="$hierarchyLevelVar='software'"> |
383 |
<xsl:element name="dc:type"> |
384 |
<xsl:value-of select="normalize-space(.)"/> |
385 |
</xsl:element> |
386 |
<xsl:element name="dc:type"> |
387 |
<xsl:text>Software</xsl:text> |
388 |
</xsl:element> |
389 |
</xsl:when> |
390 |
|
391 |
<xsl:when test="$hierarchyLevelVar='service'"> |
392 |
<xsl:element name="dc:type"> |
393 |
<xsl:value-of select="normalize-space(.)"/> |
394 |
</xsl:element> |
395 |
<xsl:element name="dc:type"> |
396 |
<xsl:text>Service</xsl:text> |
397 |
</xsl:element> |
398 |
</xsl:when> |
399 |
|
400 |
<xsl:when test="$hierarchyLevelVar='model'"> |
401 |
<xsl:element name="dc:type"> |
402 |
<xsl:value-of select="normalize-space(.)"/> |
403 |
</xsl:element> |
404 |
<xsl:element name="dc:type"> |
405 |
<xsl:text>Dataset</xsl:text> |
406 |
</xsl:element> |
407 |
</xsl:when> |
408 |
|
409 |
<xsl:when test="$hierarchyLevelVar='tile'"> |
410 |
<xsl:element name="dc:type"> |
411 |
<xsl:value-of select="normalize-space(.)"/> |
412 |
</xsl:element> |
413 |
<xsl:element name="dc:type"> |
414 |
<xsl:text>Dataset</xsl:text> |
415 |
</xsl:element> |
416 |
</xsl:when> |
417 |
|
418 |
<xsl:otherwise> |
419 |
<!-- Nothing. This should be never happen. --> |
420 |
</xsl:otherwise> |
421 |
</xsl:choose> |
422 |
</xsl:for-each> |
423 |
|
424 |
<!-- element type conversion(2) --> |
425 |
<!-- ISO CORE --> |
426 |
<xsl:for-each select="./identificationInfo/*/spatialRepresentationType"> |
427 |
<xsl:element name="dc:type"> |
428 |
<xsl:value-of select="normalize-space(.)"/> |
429 |
</xsl:element> |
430 |
</xsl:for-each> |
431 |
|
432 |
<xsl:for-each select="./identificationInfo/*/citation/*/presentationForm"> |
433 |
<xsl:element name="dc:type"> |
434 |
<xsl:value-of select="normalize-space(.)"/> |
435 |
</xsl:element> |
436 |
</xsl:for-each> |
437 |
|
438 |
|
439 |
<!-- Format element conversion --> |
440 |
<!-- ISO COMPREHENSIVE E ISO CORE --> |
441 |
<xsl:for-each select="./distributionInfo/MD_Distribution/distributionFormat/MD_Format"> |
442 |
<xsl:element name="dc:format"> |
443 |
<xsl:value-of select="./name"/> |
444 |
</xsl:element> |
445 |
</xsl:for-each> |
446 |
|
447 |
<!--xsl:for-each select="./identificationInfo/*/resourceFormat/MD_Format"> |
448 |
<xsl:element name="dc:format"> |
449 |
<xsl:value-of select="./name"/> |
450 |
</xsl:element> |
451 |
</xsl:for-each--> |
452 |
|
453 |
|
454 |
<!-- identifier element conversion: --> |
455 |
<!-- For this element there are five possible ways. --> |
456 |
|
457 |
<xsl:for-each select="./distributionInfo/MD_Distribution/transferOptions/MD_DigitalTransferOptions/onLine/CI_OnlineResource"> |
458 |
<xsl:element name="dc:identifier"> |
459 |
<xsl:if test="./linkage"> |
460 |
<xsl:value-of select="./linkage"/> |
461 |
</xsl:if> |
462 |
</xsl:element> |
463 |
</xsl:for-each> |
464 |
|
465 |
<xsl:for-each select="./identificationInfo/*/citation/*/identifier/MD_Identifier"> |
466 |
<xsl:element name="dc:identifier"> |
467 |
<xsl:value-of select="./code"/> |
468 |
</xsl:element> |
469 |
</xsl:for-each> |
470 |
|
471 |
<xsl:for-each select="./identificationInfo/*/citation/*/ISBN"> |
472 |
<xsl:variable name="isbnVar"> |
473 |
<!-- it's translated to lower case --> |
474 |
<xsl:value-of select="translate(normalize-space(.),$xsltsl-str-upper, $xsltsl-str-lower)"/> |
475 |
</xsl:variable> |
476 |
<xsl:element name="dc:identifier"> |
477 |
<xsl:choose> |
478 |
<xsl:when test="contains($isbnVar, 'isbn')"> |
479 |
<xsl:value-of select="."/> |
480 |
</xsl:when> |
481 |
<xsl:otherwise> |
482 |
<xsl:text>ISBN </xsl:text><xsl:value-of select="."/> |
483 |
</xsl:otherwise> |
484 |
</xsl:choose> |
485 |
</xsl:element> |
486 |
</xsl:for-each> |
487 |
|
488 |
<xsl:for-each select="./identificationInfo/*/citation/*/ISSN"> |
489 |
<xsl:variable name="issnVar"> |
490 |
<!-- it's translated to lower case --> |
491 |
<xsl:value-of select="translate(normalize-space(.),$xsltsl-str-upper, $xsltsl-str-lower)"/> |
492 |
</xsl:variable> |
493 |
<xsl:element name="dc:identifier"> |
494 |
<xsl:choose> |
495 |
<xsl:when test="contains($issnVar, 'issn')"> |
496 |
<xsl:value-of select="."/> |
497 |
</xsl:when> |
498 |
<xsl:otherwise> |
499 |
<xsl:text>ISSN </xsl:text><xsl:value-of select="."/> |
500 |
</xsl:otherwise> |
501 |
</xsl:choose> |
502 |
</xsl:element> |
503 |
</xsl:for-each> |
504 |
|
505 |
<xsl:if test="./dataSetURI"> |
506 |
<xsl:element name="dc:identifier"> |
507 |
<xsl:value-of select="./dataSetURI"/> |
508 |
</xsl:element> |
509 |
</xsl:if> |
510 |
|
511 |
<!-- source element conversion: --> |
512 |
<!-- ISO COMPREHENSIVE --> |
513 |
|
514 |
<xsl:for-each select="./dataQualityInfo/DQ_DataQuality/lineage/LI_Lineage/source/LI_Source/description"> |
515 |
<xsl:element name="dc:source"> |
516 |
<xsl:value-of select="."/> |
517 |
</xsl:element> |
518 |
</xsl:for-each> |
519 |
|
520 |
|
521 |
<!-- ISO CORE N/A ???GAP!!! --> |
522 |
|
523 |
<!-- language element conversion. --> |
524 |
<!-- ISO COMPREHENSIVE E ISO CORE --> |
525 |
<xsl:for-each select="./identificationInfo/*/language"> |
526 |
<xsl:element name="dc:language"> |
527 |
<xsl:value-of select="."/> |
528 |
</xsl:element> |
529 |
<!--xsl:if test="./isoCode"--> |
530 |
<!--/xsl:if--> |
531 |
<!--xsl:if test="./isoName"--> |
532 |
<!--/xsl:if--> |
533 |
<!--xsl:if test="./otherLang"--> |
534 |
<!--/xsl:if--> |
535 |
</xsl:for-each> |
536 |
|
537 |
<!-- relation element conversion: --> |
538 |
<!-- ISO COMPREHENSIVE --> |
539 |
<xsl:for-each select="./identificationInfo/*/citation/*/series/*/name"> |
540 |
<xsl:element name="dc:relation"> |
541 |
<xsl:value-of select="."/> |
542 |
</xsl:element> |
543 |
</xsl:for-each> |
544 |
<xsl:for-each select="./identificationInfo/*/aggregationInfo/MD_AggregateInformation/aggregateDataSetIdentifier/code"> |
545 |
<xsl:element name="dc:relation"> |
546 |
<xsl:value-of select="."/> |
547 |
</xsl:element> |
548 |
</xsl:for-each> |
549 |
|
550 |
<!-- ISO CORE N/A ???GAP!!! --> |
551 |
|
552 |
|
553 |
<!-- dcterms:temporal; dcterms:spatial; two separted elements--> |
554 |
|
555 |
<!-- dcterms temporal --> |
556 |
<xsl:choose> |
557 |
<xsl:when test="count(./identificationInfo/*/descriptiveKeywords/MD_Keywords[type='temporal']) > 0 |
558 |
or ./identificationInfo/*/extent/*/temporalElement/*/extent/beginEnd"> |
559 |
<!-- Some temporal will contain only a keyword or something like name=The Great Depression; start=1929; end=1939; --> |
560 |
|
561 |
<xsl:if test="./identificationInfo/*/extent/*/temporalElement/*/extent/beginEnd"> |
562 |
<xsl:element name="dcterms:temporal"> |
563 |
<xsl:attribute name="xsi:type">dcterms:Period</xsl:attribute> |
564 |
<xsl:text>begin=</xsl:text> |
565 |
<xsl:value-of select="./identificationInfo/*/extent/*/temporalElement/*/extent/beginEnd/begin"/> |
566 |
<xsl:text>; </xsl:text> |
567 |
<xsl:text>end=</xsl:text> |
568 |
<xsl:value-of select="./identificationInfo/*/extent/*/temporalElement/*/extent/beginEnd/end"/> |
569 |
<xsl:text>;</xsl:text> |
570 |
</xsl:element> |
571 |
</xsl:if> |
572 |
<xsl:for-each select="./identificationInfo/*/descriptiveKeywords/MD_Keywords[type='temporal']"> |
573 |
<xsl:element name="dcterms:temporal"> |
574 |
<xsl:value-of select="./keyword"/> |
575 |
</xsl:element> |
576 |
</xsl:for-each> |
577 |
</xsl:when> |
578 |
</xsl:choose> |
579 |
|
580 |
<!-- dcterms spatial --> |
581 |
<xsl:choose> |
582 |
<xsl:when test="count(./identificationInfo/*/descriptiveKeywords/MD_Keywords[type='place']) > 0 |
583 |
or ./identificationInfo/*/extent/*/geographicElement/*/northBoundLatitude"> |
584 |
<!-- Some spatial will contain only a keyword or something like name=The Great Depression; start=1929; end=1939; --> |
585 |
|
586 |
<xsl:if test="./identificationInfo/*/extent/*/geographicElement/*/northBoundLatitude"> |
587 |
<xsl:element name="dcterms:spatial"> |
588 |
<xsl:text>northlimit=</xsl:text> |
589 |
<xsl:value-of select="./identificationInfo/*/extent/*/geographicElement/*/northBoundLatitude"/> |
590 |
<xsl:text>; </xsl:text> |
591 |
<xsl:text>southlimit=</xsl:text> |
592 |
<xsl:value-of select="./identificationInfo/*/extent/*/geographicElement/*/southBoundLatitude"/> |
593 |
<xsl:text>; </xsl:text> |
594 |
<xsl:text>westlimit=</xsl:text> |
595 |
<xsl:value-of select="./identificationInfo/*/extent/*/geographicElement/*/westBoundLongitude"/> |
596 |
<xsl:text>; </xsl:text> |
597 |
<xsl:text>eastlimit=</xsl:text> |
598 |
<xsl:value-of select="./identificationInfo/*/extent/*/geographicElement/*/eastBoundLongitude"/> |
599 |
<xsl:text>; </xsl:text> |
600 |
</xsl:element> |
601 |
</xsl:if> |
602 |
<xsl:for-each select="./identificationInfo/*/descriptiveKeywords/MD_Keywords[type='place']"> |
603 |
<xsl:element name="dcterms:spatial"> |
604 |
<xsl:value-of select="./keyword"/> |
605 |
</xsl:element> |
606 |
</xsl:for-each> |
607 |
</xsl:when> |
608 |
</xsl:choose> |
609 |
|
610 |
<!-- rights element conversion. --> |
611 |
<!-- ISO COMPREHENSIVE --> |
612 |
|
613 |
<xsl:if test="./identificationInfo/*/resourceConstraints/MD_LegalConstraints/accessConstraints"> |
614 |
<xsl:for-each select="./identificationInfo/*/resourceConstraints/MD_LegalConstraints/accessConstraints"> |
615 |
<xsl:variable name="rightsVar"> |
616 |
<!-- it's translated to lower case --> |
617 |
<xsl:value-of select="translate(normalize-space(.),$xsltsl-str-upper, $xsltsl-str-lower)"/> |
618 |
</xsl:variable> |
619 |
<xsl:element name="dc:rights"> |
620 |
<xsl:choose> |
621 |
<xsl:when test="$rightsVar='copyright'"> |
622 |
<xsl:text>copyright</xsl:text> |
623 |
</xsl:when> |
624 |
<xsl:when test="$rightsVar='patent'"> |
625 |
<xsl:text>patent</xsl:text> |
626 |
</xsl:when> |
627 |
<xsl:when test="$rightsVar='patentpending'"> |
628 |
<xsl:text>patentPending</xsl:text> |
629 |
</xsl:when> |
630 |
<xsl:when test="$rightsVar='trademark'"> |
631 |
<xsl:text>trademark</xsl:text> |
632 |
</xsl:when> |
633 |
<xsl:when test="$rightsVar='license'"> |
634 |
<xsl:text>license</xsl:text> |
635 |
</xsl:when> |
636 |
<xsl:when test="$rightsVar='intellectualpropertyrights'"> |
637 |
<xsl:text>intellectualPropertyRights</xsl:text> |
638 |
</xsl:when> |
639 |
<xsl:when test="$rightsVar='restricted'"> |
640 |
<xsl:text>restricted</xsl:text> |
641 |
</xsl:when> |
642 |
<xsl:when test="$rightsVar='otherrestrictions'"> |
643 |
<xsl:text>otherRestrictions</xsl:text> |
644 |
</xsl:when> |
645 |
<xsl:otherwise> |
646 |
<!-- If the value is not in this list the data in ISO is not |
647 |
correct. However, the value is translated to DC.--> |
648 |
<xsl:value-of select="normalize-space(.)"/> |
649 |
</xsl:otherwise> |
650 |
</xsl:choose> |
651 |
</xsl:element> |
652 |
</xsl:for-each> |
653 |
</xsl:if> |
654 |
|
655 |
<xsl:if test="./identificationInfo/*/resourceConstraints/MD_LegalConstraints/useConstraints"> |
656 |
<!-- There is, at least, one--> |
657 |
<xsl:for-each select="./identificationInfo/*/resourceConstraints/MD_LegalConstraints/useConstraints"> |
658 |
<xsl:variable name="rightsVar2"> |
659 |
<!-- it's translated to lower case --> |
660 |
<xsl:value-of select="translate(normalize-space(.),$xsltsl-str-upper, $xsltsl-str-lower)"/> |
661 |
</xsl:variable> |
662 |
<xsl:element name="dc:rights"> |
663 |
<xsl:choose> |
664 |
<xsl:when test="$rightsVar2='copyright'"> |
665 |
<xsl:text>copyright</xsl:text> |
666 |
</xsl:when> |
667 |
<xsl:when test="$rightsVar2='patent'"> |
668 |
<xsl:text>patent</xsl:text> |
669 |
</xsl:when> |
670 |
<xsl:when test="$rightsVar2='patentpending'"> |
671 |
<xsl:text>patentPending</xsl:text> |
672 |
</xsl:when> |
673 |
<xsl:when test="$rightsVar2='trademark'"> |
674 |
<xsl:text>trademark</xsl:text> |
675 |
</xsl:when> |
676 |
<xsl:when test="$rightsVar2='license'"> |
677 |
<xsl:text>license</xsl:text> |
678 |
</xsl:when> |
679 |
<xsl:when test="$rightsVar2='intellectualpropertyrights'"> |
680 |
<xsl:text>intellectualPropertyRights</xsl:text> |
681 |
</xsl:when> |
682 |
<xsl:when test="$rightsVar2='restricted'"> |
683 |
<xsl:text>restricted</xsl:text> |
684 |
</xsl:when> |
685 |
<xsl:when test="$rightsVar2='otherrestrictions'"> |
686 |
<xsl:text>otherRestrictions</xsl:text> |
687 |
</xsl:when> |
688 |
<xsl:otherwise> |
689 |
<!-- If the value is not in this list the data in ISO is not |
690 |
correct. However, the value is translated to DC.--> |
691 |
<xsl:value-of select="normalize-space(.)"/> |
692 |
</xsl:otherwise> |
693 |
</xsl:choose> |
694 |
</xsl:element> |
695 |
</xsl:for-each> |
696 |
</xsl:if> |
697 |
|
698 |
<xsl:for-each select="./identificationInfo/*/resourceConstraints/MD_LegalConstraints/otherConstraints"> |
699 |
<xsl:element name="dc:rights"> |
700 |
<xsl:value-of select="normalize-space(.)"/> |
701 |
</xsl:element> |
702 |
</xsl:for-each> |
703 |
|
704 |
<!-- ISO CORE N/A ???GAP!!! --> |
705 |
</qualifieddc> |
706 |
<!--/xsl:element--> |
707 |
</xsl:template> |
708 |
</xsl:stylesheet> |