forked from qgisinspiretools/qgis-wfs20-client-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iso19139jw.xsl
462 lines (423 loc) · 23.6 KB
/
iso19139jw.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
<?xml version="1.0" encoding="UTF-8"?>
<!--
"""
/***************************************************************************
Metadata Viewer
ISO 19139 Metadata to HTML XSL-Transformation
- - - - - - - -
begin : 2012-08-14
update : 2012-10-27
copyright : (c) 2012 by Juergen Weichand
email : [email protected]
web : weichand.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
-->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:wei="http://www.weichand.de"
exclude-result-prefixes="gmd gco csw srv">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template name="tableRow" >
<xsl:param name="key"/>
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="string($value)">
<tr>
<td>
<xsl:attribute name="width">
<xsl:value-of select="'20%'"/>
</xsl:attribute>
<xsl:value-of select="$key"/>
</td>
<td>
<xsl:value-of select="$value"/>
</td>
</tr>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="tableRowLink" >
<xsl:param name="key"/>
<xsl:param name="url"/>
<xsl:param name="name"/>
<xsl:param name="description"/>
<xsl:choose>
<xsl:when test="string($url)">
<tr>
<td>
<xsl:attribute name="width">
<xsl:value-of select="'20%'"/>
</xsl:attribute>
<xsl:value-of select="$key"/>
</td>
<td>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$url"/>
</xsl:attribute>
<!--
<xsl:attribute name="target">
<xsl:value-of select="'_blank'"/>
</xsl:attribute>
-->
<xsl:choose>
<xsl:when test="string($description)">
<xsl:attribute name="title">
<xsl:value-of select="$description"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string($name)">
<xsl:value-of select="$name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$url"/>
</xsl:otherwise>
</xsl:choose>
</a>
</td>
</tr>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
color: #8B0000;
background: #E6E6E6;
font-family: Arial,Helvetica,sans-serif;
font-size: 1.2em;
text-align: center;
}
.top {
color: #000000;
font-size: 1.6em;
font-weight: bold;
text-align: center;
}
.copyright {
color: #000000;
font-size: 0.6em;
text-align: center;
}
table {
text-align: center;
width: 852px;
border:1px solid #696969;
background: #FAFAFA;
margin: 1em auto;
border-collapse: collapse;
}
caption {
color: #2E2E2E;
font-weight: bolder;
font-size: 0.9em;
text-align: center;
}
.subcaption {
color: #2E2E2E;
font-weight: bolder;
font-size: 0.9em;
text-align: left;
}
td {
border:1px solid #696969;
color: #3F3F3F;
font-size: 0.8em;
padding: .3em 1em;
text-align: left;
}
</style>
</head>
<body>
<xsl:apply-templates select="//gmd:MD_Metadata" />
<p class="copyright">
Metadata Viewer - <a href="http://www.weichand.de/">http://www.weichand.de</a> - (c) Juergen Weichand<br />
Version: 2012-10-27
</p>
</body>
</html>
</xsl:template>
<xsl:template match="gmd:MD_Metadata">
<table style="background: #F2F2F2">
<caption>Identification Info</caption>
<tr>
<td>
<table>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Title'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/gmd:citation/*/gmd:title/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Alternate Title'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/gmd:citation/*/gmd:alternateTitle/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Abstract'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/gmd:abstract/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Purpose'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/gmd:purpose/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Identifier'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/gmd:citation/*/gmd:identifier/*/gmd:code/gco:CharacterString"/>
</xsl:call-template>
<tr>
<td>Date(s)</td>
<td>
<xsl:apply-templates select="gmd:identificationInfo[1]/*/gmd:citation/*/gmd:date" />
</td>
</tr>
<tr>
<td>Keyword(s)</td>
<td>
<xsl:apply-templates select="gmd:identificationInfo[1]/*/gmd:descriptiveKeywords" />
</td>
</tr>
</table>
<xsl:apply-templates select="gmd:identificationInfo[1]/*/*/gmd:EX_Extent" />
<!-- Service -->
<table>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Service Type'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/srv:serviceType/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Service Type Version'"/>
<xsl:with-param name="value" select="gmd:identificationInfo[1]/*/srv:serviceTypeVersion/gco:CharacterString"/>
</xsl:call-template>
<xsl:apply-templates select="gmd:identificationInfo[1]/srv:SV_ServiceIdentification" />
</table>
<xsl:apply-templates select="gmd:identificationInfo[1]/*/gmd:pointOfContact/gmd:CI_ResponsibleParty" />
</td>
</tr>
</table>
<table style="background: #F2F2F2">
<caption>Distribution Info</caption>
<tr>
<td>
<table>
<xsl:apply-templates select="gmd:distributionInfo[1]/*/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine" />
</table>
<xsl:apply-templates select="gmd:distributionInfo[1]/*/gmd:distributor/gmd:MD_Distributor/gmd:distributorContact/gmd:CI_ResponsibleParty" />
</td>
</tr>
</table>
<table style="background: #F2F2F2">
<caption>Metadata</caption>
<tr>
<td>
<table>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'File Identifier'"/>
<xsl:with-param name="value" select="gmd:fileIdentifier/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Language'"/>
<xsl:with-param name="value" select="gmd:language/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Character Set'"/>
<xsl:with-param name="value" select="gmd:characterSet/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Hierarchy Level'"/>
<xsl:with-param name="value" select="gmd:hierarchyLevel/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Hierarchy Level Name'"/>
<xsl:with-param name="value" select="gmd:hierarchyLevelName/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Metadata Standard Name'"/>
<xsl:with-param name="value" select="gmd:metadataStandardName/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Metadata Standard Version'"/>
<xsl:with-param name="value" select="gmd:metadataStandardVersion/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Date Stamp'"/>
<xsl:with-param name="value" select="gmd:dateStamp/*"/>
</xsl:call-template>
</table>
<table>
<xsl:apply-templates select="gmd:referenceSystemInfo/gmd:MD_ReferenceSystem/gmd:referenceSystemIdentifier/gmd:RS_Identifier" />
</table>
<xsl:apply-templates select="gmd:contact/gmd:CI_ResponsibleParty" />
</td>
</tr>
</table>
</xsl:template>
<!-- ##################################################################################### -->
<xsl:template match="gmd:descriptiveKeywords">
<xsl:for-each select="gmd:MD_Keywords/gmd:keyword/gco:CharacterString">
<xsl:value-of select="."/>
<br />
</xsl:for-each>
</xsl:template>
<xsl:template match="gmd:date">
<xsl:for-each select=".">
<xsl:variable name="date">
<xsl:value-of select="gmd:CI_Date/gmd:date/*"/>
</xsl:variable>
<xsl:variable name="dateType">
<xsl:value-of select="gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue"/>
</xsl:variable>
<xsl:value-of select="concat($date, ' (', $dateType, ')')"/>
<br />
</xsl:for-each>
</xsl:template>
<xsl:template match="gmd:RS_Identifier">
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="gmd:codeSpace/gco:CharacterString"/>
<xsl:with-param name="value" select="gmd:code/gco:CharacterString"/>
</xsl:call-template>
</xsl:template>
<!--gmd:version/gco:CharacterString -->
<xsl:template match="gmd:EX_Extent">
<table>
<!-- <caption>Extent</caption> -->
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Description'"/>
<xsl:with-param name="value" select="gmd:description/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'East Bound Longitude'"/>
<xsl:with-param name="value" select="gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:eastBoundLongitude/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'North Bound Latitude'"/>
<xsl:with-param name="value" select="gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:northBoundLatitude/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'West Bound Longitude'"/>
<xsl:with-param name="value" select="gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:westBoundLongitude/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'South Bound Latitude'"/>
<xsl:with-param name="value" select="gmd:geographicElement/gmd:EX_GeographicBoundingBox/gmd:southBoundLatitude/*"/>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template match="gmd:CI_ResponsibleParty">
<table>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Individual Name'"/>
<xsl:with-param name="value" select="gmd:individualName/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Organisation Name'"/>
<xsl:with-param name="value" select="gmd:organisationName/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Position Name'"/>
<xsl:with-param name="value" select="gmd:positionName/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Telephone'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:voice/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Facsimile'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:phone/gmd:CI_Telephone/gmd:facsimile/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Delivery Point'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:deliveryPoint/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Postal Code'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:postalCode/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'City'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:city/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Administrative Area'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:administrativeArea/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Country'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:country/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Electronic Mail Address'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:address/gmd:CI_Address/gmd:electronicMailAddress/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Online Resource'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource/gmd:CI_OnlineResource/gmd:linkage/*"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Hours of Service'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:hoursOfService/gco:CharacterString"/>
</xsl:call-template>
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Contact Instructions'"/>
<xsl:with-param name="value" select="gmd:contactInfo/gmd:CI_Contact/gmd:contactInstructions/gco:CharacterString"/>
</xsl:call-template>
<!--
<xsl:call-template name="tableRow">
<xsl:with-param name="key" select="'Role'"/>
<xsl:with-param name="value" select="gmd:role/gmd:CI_RoleCode/@codeListValue"/>
</xsl:call-template>
-->
</table>
</xsl:template>
<xsl:template match="gmd:onLine">
<xsl:call-template name="tableRowLink">
<xsl:with-param name="key" select="'Online Resource'"/>
<xsl:with-param name="url" select="gmd:CI_OnlineResource/gmd:linkage/gmd:URL"/>
<xsl:with-param name="name" select="gmd:CI_OnlineResource/gmd:name/gco:CharacterString"/>
<xsl:with-param name="description" select="gmd:CI_OnlineResource/gmd:description/gco:CharacterString"/>
</xsl:call-template>
<!-- gmd:CI_OnlineResource/gmd:applicationProfile/gco:CharacterString -->
<!-- gmd:CI_OnlineResource/gmd:function/gmd:CI_OnLineFunctionCode/@codeListValue -->
</xsl:template>
<!-- SERVICE -->
<xsl:template match="srv:SV_ServiceIdentification">
<tr>
<td>Operations</td>
<td>
<xsl:for-each select="srv:containsOperations/srv:SV_OperationMetadata/srv:operationName/gco:CharacterString">
<xsl:value-of select="."/>
<br />
</xsl:for-each>
</td>
</tr>
<xsl:apply-templates select="srv:operatesOn" />
</xsl:template>
<xsl:template match="srv:operatesOn">
<xsl:call-template name="tableRowLink">
<xsl:with-param name="key" select="'Operates On'"/>
<xsl:with-param name="url" select="@xlink:href"/>
<xsl:with-param name="name" select="@xlink:title"/>
<xsl:with-param name="description" select="@uuidref"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>