1
|
<?xml version="1.0"?>
|
2
|
<xsl:stylesheet
|
3
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
4
|
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
5
|
xmlns:gco="http://www.isotc211.org/2005/gco"
|
6
|
xmlns:gmx="http://www.isotc211.org/2005/gmx"
|
7
|
xmlns:gml="http://www.opengis.net/gml/3.2"
|
8
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
9
|
version="1.0">
|
10
|
|
11
|
<xsl:import href="iso-ci.xsl"/>
|
12
|
<xsl:import href="iso-ex.xsl"/>
|
13
|
<xsl:import href="iso-md.xsl"/>
|
14
|
|
15
|
<xsl:output method="html" encoding="UTF-8"
|
16
|
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
17
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
18
|
indent="yes" />
|
19
|
|
20
|
<!-- TODO: Figure out how to set the output method to get what I want -->
|
21
|
<!-- TODO: ^ Figure out what I want to output -->
|
22
|
<!-- TODO: Figuer out what this match statement should have in it -->
|
23
|
<!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification -->
|
24
|
|
25
|
<xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']">
|
26
|
<form class="form-horizontal">
|
27
|
<div class="control-group entity">
|
28
|
<h4>General</h4>
|
29
|
<!-- fileIdentifier 1:1 -->
|
30
|
<div class="control-group">
|
31
|
<label class="control-label">Identifier</label>
|
32
|
<div class="controls">
|
33
|
<div class="controls-well">
|
34
|
<xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
|
35
|
</div>
|
36
|
</div>
|
37
|
</div>
|
38
|
|
39
|
<!-- TODO: language 1:1 -->
|
40
|
<!-- TODO: characterSet 1:1 -->
|
41
|
|
42
|
<!-- Parent Identifier 1:1 conditional -->
|
43
|
<xsl:if test="//gmd:parentIdentifier">
|
44
|
<div class="control-group">
|
45
|
<label class="control-label">Parent Identifier</label>
|
46
|
<div class="controls">
|
47
|
<div class="controls-well">
|
48
|
<xsl:value-of select="//gmd:parentIdentifier/gco:CharacterString/text()" />
|
49
|
</div>
|
50
|
</div>
|
51
|
</div>
|
52
|
</xsl:if>
|
53
|
|
54
|
<!-- TODO: hierarchyLevel 0:inf -->
|
55
|
<!-- TODO: hierarchyLevelName 0:inf -->
|
56
|
|
57
|
<!-- Alternate identifier(s) 0:inf-->
|
58
|
<!-- gmd:identifier is an optional aprt of the CI_Citation element -->
|
59
|
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
|
60
|
<div class="control-group">
|
61
|
<label class="control-label">Cited Identifier</label>
|
62
|
<div class="controls">
|
63
|
<div class="controls-well">
|
64
|
<xsl:apply-templates />
|
65
|
</div>
|
66
|
</div>
|
67
|
</div>
|
68
|
</xsl:for-each>
|
69
|
|
70
|
<!-- Abstract 1:inf-->
|
71
|
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
|
72
|
<div class="control-group">
|
73
|
<label class="control-label">Abstract</label>
|
74
|
<div class="controls">
|
75
|
<div class="controls-well">
|
76
|
<xsl:apply-templates />
|
77
|
</div>
|
78
|
</div>
|
79
|
</div>
|
80
|
</xsl:for-each>
|
81
|
|
82
|
<!-- Topic Categories -->
|
83
|
<xsl:if test="//gmd:topicCategory">
|
84
|
<div class="control-group">
|
85
|
<label class="control-label">Topic Categories</label>
|
86
|
<div class="controls">
|
87
|
<div class="controls-well">
|
88
|
<ul>
|
89
|
<xsl:for-each select="//gmd:topicCategory">
|
90
|
<li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>
|
91
|
</xsl:for-each>
|
92
|
</ul>
|
93
|
</div>
|
94
|
</div>
|
95
|
</div>
|
96
|
</xsl:if>
|
97
|
|
98
|
<!-- Keywords
|
99
|
|
100
|
Each <gmd:descriptiveKeywords> block should have one or more keywords in it
|
101
|
with one thesaurus. So we render keywords from the same thesaurus together.
|
102
|
-->
|
103
|
<xsl:if test="//gmd:descriptiveKeywords">
|
104
|
<div class="control-group">
|
105
|
<label class="control-label">Descriptive Keywords</label>
|
106
|
<div class="controls">
|
107
|
<div class="controls-well">
|
108
|
<xsl:for-each select="//gmd:descriptiveKeywords">
|
109
|
<xsl:apply-templates />
|
110
|
</xsl:for-each>
|
111
|
</div>
|
112
|
</div>
|
113
|
</div>
|
114
|
</xsl:if>
|
115
|
</div>
|
116
|
|
117
|
<div class="control-group entity">
|
118
|
<h4>People and Associated Parties</h4>
|
119
|
|
120
|
<!-- Metadata Contact(s) 1:inf -->
|
121
|
<div class="control-group">
|
122
|
<label class="control-label">Metadata Contact(s)</label>
|
123
|
<div class="controls">
|
124
|
<div class="controls-well">
|
125
|
<xsl:for-each select="//gmd:contact">
|
126
|
<xsl:apply-templates />
|
127
|
</xsl:for-each>
|
128
|
</div>
|
129
|
</div>
|
130
|
</div>
|
131
|
|
132
|
<!-- Data Set Contact(s) -->
|
133
|
<div class="control-group">
|
134
|
<label class="control-label">Data Set Contacts</label>
|
135
|
<div class="controls">
|
136
|
<div class="controls-well">
|
137
|
<xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
|
138
|
</div>
|
139
|
</div>
|
140
|
</div>
|
141
|
|
142
|
<!-- Cited responsible parties-->
|
143
|
<div class="control-group">
|
144
|
<label class="control-label">Associated Parties</label>
|
145
|
<div class="controls">
|
146
|
<div class="controls-well">
|
147
|
<xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
|
148
|
</div>
|
149
|
</div>
|
150
|
</div>
|
151
|
</div>
|
152
|
|
153
|
<!-- TODO: otherEntities? -->
|
154
|
|
155
|
<!-- Extent (geographic, temporal, vertical) -->
|
156
|
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
|
157
|
<xsl:apply-templates />
|
158
|
</xsl:for-each>
|
159
|
|
160
|
<!-- TODO Methods -->
|
161
|
|
162
|
</form>
|
163
|
</xsl:template>
|
164
|
|
165
|
<!-- General, high-level templates -->
|
166
|
|
167
|
<!-- TODO: Figure out how to do this: I want to capture the scenario where
|
168
|
an element like gmd:individualName has on child gco:CharacterString or
|
169
|
equivalent but has a nilReasona attribute. -->
|
170
|
<xsl:template match="@nilReason">
|
171
|
<xsl:value-of select="@nilReason" />
|
172
|
</xsl:template>
|
173
|
|
174
|
<xsl:template match="gco:CharacterString">
|
175
|
<xsl:value-of select="." />
|
176
|
</xsl:template>
|
177
|
|
178
|
<xsl:template match="gmx:Anchor">
|
179
|
<xsl:element name="a">
|
180
|
<xsl:attribute name="href">
|
181
|
<xsl:value-of select="./@xlink:href" />
|
182
|
</xsl:attribute>
|
183
|
|
184
|
<!-- Create the attributes for a Bootstrap tooltip to hold the title -->
|
185
|
<xsl:if test="./@xlink:title">
|
186
|
<xsl:attribute name="data-toggle">tooltip</xsl:attribute>
|
187
|
<xsl:attribute name="data-placement">top</xsl:attribute>
|
188
|
<xsl:attribute name="title"><xsl:value-of select="./@xlink:title" /></xsl:attribute>
|
189
|
</xsl:if>
|
190
|
|
191
|
<xsl:value-of select="./text()" />
|
192
|
</xsl:element>
|
193
|
</xsl:template>
|
194
|
|
195
|
<xsl:template match="gmd:URL">
|
196
|
<xsl:variable name="url"><xsl:value-of select="./text()" /></xsl:variable>
|
197
|
<xsl:element name="a">
|
198
|
<xsl:attribute name="href">
|
199
|
<xsl:value-of select="$url" />
|
200
|
</xsl:attribute>
|
201
|
<xsl:value-of select="$url" />
|
202
|
</xsl:element>
|
203
|
</xsl:template>
|
204
|
</xsl:stylesheet>
|