Project

General

Profile

1 10046 mecum
<?xml version="1.0"?>
2
<xsl:stylesheet
3 10169 mecum
    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:gml="http://www.opengis.net/gml/3.2" version="1.0">
7 10058 mecum
    <xsl:template match="gmd:EX_Extent">
8 10169 mecum
        <h4>Coverage</h4>
9
        <!-- description -->
10
        <xsl:if test=".//gmd:description">
11
            <div class="control-group">
12
                <label class="control-label">Description</label>
13
                <div class="controls">
14
                    <div class="controls-well">
15
                        <xsl:apply-templates />
16
                    </div>
17
                </div>
18 10058 mecum
            </div>
19 10169 mecum
        </xsl:if>
20 10046 mecum
21 10169 mecum
        <!-- Geographic -->
22
        <xsl:for-each select=".//gmd:geographicElement">
23
            <div class="row-fluid geographicCoverage">
24
                <div class="control-group">
25
                    <label class="control-label">Geographic</label>
26
                    <div class="controls">
27
                        <div class="controls-well">
28
                            <xsl:apply-templates />
29
                        </div>
30
                    </div>
31
                </div>
32 10058 mecum
            </div>
33 10169 mecum
        </xsl:for-each>
34 10046 mecum
35 10169 mecum
        <!-- Temporal -->
36
        <xsl:for-each select=".//gmd:temporalElement">
37
            <div class="control-group">
38
                <label class="control-label">Temporal</label>
39
                <div class="controls">
40
                    <div class="controls-well">
41
                        <xsl:apply-templates />
42
                    </div>
43
                </div>
44 10058 mecum
            </div>
45 10169 mecum
        </xsl:for-each>
46 10049 mecum
47 10169 mecum
        <!-- Vertical -->
48
        <xsl:for-each select=".//gmd:verticalElement">
49
            <div class="control-group">
50
                <label class="control-label">Vertical</label>
51
                <div class="controls">
52
                    <div class="controls-well">
53
                        <xsl:apply-templates />
54
                    </div>
55
                </div>
56 10058 mecum
            </div>
57 10169 mecum
        </xsl:for-each>
58 10058 mecum
    </xsl:template>
59
60 10169 mecum
    <!-- EX_GeographicExtent-->
61
    <xsl:template match="gmd:EX_GeographicExtent">
62
        <xsl:apply-templates />
63
    </xsl:template>
64 10046 mecum
65 10169 mecum
    <!-- EX_BoundingPolygon-->
66
    <xsl:template match="gmd:EX_BoundingPolygon">
67
        <xsl:apply-templates />
68
    </xsl:template>
69 10058 mecum
70 10169 mecum
    <!-- EX_GeographicDescription-->
71
    <xsl:template match="gmd:EX_GeographicDescription">
72
        <xsl:apply-templates />
73
    </xsl:template>
74 10058 mecum
75 10169 mecum
    <!-- EX_GeographicBoundingBox-->
76
    <xsl:template match="gmd:EX_GeographicBoundingBox">
77
        <!-- Set up variables for N E S W -->
78
        <xsl:variable name="north">
79
            <xsl:value-of select="./gmd:northBoundLatitude/gco:Decimal/text()" />
80
        </xsl:variable>
81
        <xsl:variable name="east">
82
            <xsl:value-of select="./gmd:eastBoundLongitude/gco:Decimal/text()" />
83
        </xsl:variable>
84
        <xsl:variable name="south">
85
            <xsl:value-of select="./gmd:southBoundLatitude/gco:Decimal/text()" />
86
        </xsl:variable>
87
        <xsl:variable name="west">
88
            <xsl:value-of select="./gmd:westBoundLongitude/gco:Decimal/text()" />
89
        </xsl:variable>
90
        <div data-value="{$north}" data-content="northBoundingCoordinate" class="control-group northBoundingCoordinate">
91
            <label class="control-label">North</label>
92
            <div class="controls">
93
                <div class="controls-well">
94
                    <xsl:value-of select="$north" />&#xa0; degrees
95
                </div>
96
            </div>
97
        </div>
98
        <div data-value="{$east}" data-content="eastBoundingCoordinate" class="control-group eastBoundingCoordinate">
99
            <label class="control-label">East</label>
100
            <div class="controls">
101
                <div class="controls-well">
102
                    <xsl:value-of select="$east" />&#xa0; degrees
103
                </div>
104
            </div>
105
        </div>
106
        <div data-value="{$south}" data-content="southBoundingCoordinate" class="control-group southBoundingCoordinate">
107
            <label class="control-label">South</label>
108
            <div class="controls">
109
                <div class="controls-well">
110
                    <xsl:value-of select="$south" />&#xa0; degrees
111
                </div>
112
            </div>
113
        </div>
114
        <div data-value="{$west}" data-content="westBoundingCoordinate" class="control-group westBoundingCoordinate">
115
            <label class="control-label">West</label>
116
            <div class="controls">
117
                <div class="controls-well">
118
                    <xsl:value-of select="$west" />&#xa0; degrees
119
                </div>
120
            </div>
121
        </div>
122
        <xsl:apply-templates select="./gmd:extentTypeCode" />
123
    </xsl:template>
124 10058 mecum
125 10169 mecum
    <!-- gmd:polygon -->
126
    <xsl:template match="gmd:polygon">
127
        <div class="control-group">
128
            <label class="control-label">Polygon</label>
129
            <div class="controls">
130
                <div class="controls-well">
131
                    <xsl:apply-templates />
132
                </div>
133
            </div>
134 10058 mecum
        </div>
135 10169 mecum
    </xsl:template>
136 10046 mecum
137 10169 mecum
    <!-- EX_TemporalExtent -->
138
    <xsl:template match="gmd:EX_TemporalExtent">
139
        <xsl:apply-templates select=".//gmd:extent/*" />
140
    </xsl:template>
141 10046 mecum
142 10169 mecum
    <!-- EX_VerticalExtent-->
143
    <!-- TODO: Improve DOM structure -->
144
    <!-- TODO: Flesh this out a bit more... -->
145
    <xsl:template match="gmd:EX_VerticalExtent">
146
        <span>minimumValue:
147
            <xsl:value-of select="./gmd:minimumValue/gco:Real" />
148
        </span>
149
        <span>maximumValue:
150
            <xsl:value-of select="./gmd:maximumValue/gco:Real" />
151
        </span>
152
        <span>verticalCRS:
153
            <xsl:value-of select="./gmd:verticalCRS" />
154
        </span>
155
    </xsl:template>
156 10046 mecum
157 10169 mecum
    <!-- TimeInstant-->
158
    <!-- TODO
159 10046 mecum
        - Attributes: frame, calendarEraName, indeterminatePosition
160
    -->
161 10169 mecum
    <xsl:template match="gml:TimeInstant">
162 10174 mecum
        <label class="control-label">Instant</label>
163
        <div class="controls">
164
            <div class="controls-well">
165
                <xsl:if test="./gmd:description">
166
                    <label class="control-label">Description</label>
167
                    <div class="controls">
168
                        <div class="controls-well">
169
                            <xsl:if test="./gmd:description">
170
                                <xsl:value-of select=".//gmd:description" />
171
                            </xsl:if>
172
                        </div>
173
                    </div>
174
                </xsl:if>
175
176
                <label class="control-label">Time Position</label>
177
                <div class="controls">
178
                    <div class="controls-well">
179
                        <xsl:value-of select=".//gml:timePosition" />
180
                    </div>
181
                </div>
182
183
                <xsl:if test=".//gml:timePosition/@calendarEraName">
184
                    <label class="control-label">Calendar Era Name</label>
185
                    <div class="controls">
186
                        <div class="controls-well">
187
                            <xsl:value-of select=".//gml:timePosition/@calendarEraName" />
188
                        </div>
189
                    </div>
190
191
192
                </xsl:if>
193
                <xsl:if test=".//gml:timePosition/@indeterminatePosition">
194
                    <label class="control-label">Time Position</label>
195
                    <div class="controls">
196
                        <div class="controls-well">
197
                            <xsl:value-of select=".//gml:timePosition/@indeterminatePosition" />
198
                        </div>
199
                    </div>
200
                </xsl:if>
201
            </div>
202 10169 mecum
        </div>
203
    </xsl:template>
204 10046 mecum
205 10169 mecum
    <!-- TimePeriod-->
206
    <!-- TODO:
207 10046 mecum
        - All the attributes
208
        - timeInterval units, radix, factor
209
    -->
210 10169 mecum
    <xsl:template match="gml:TimePeriod">
211
        <xsl:if test=".//gml:beginPosition">
212
            <div class="control-group">
213
                <label class="control-label">Begin</label>
214
                <div class="controls">
215 10174 mecum
                    <div class="controls-well"><xsl:value-of select=".//gml:beginPosition" /></div>
216 10169 mecum
                    <xsl:if test=".//gml:beginPosition/@calendarEraName">
217
                        <span>
218
                            <xsl:value-of select=".//gml:beginPosition/@calendarEraName" /> (calendarEraName)
219
                        </span>
220
                    </xsl:if>
221
                    <xsl:if test=".//gml:beginPosition/@indeterminatePosition">
222
                        <span>
223
                            <xsl:value-of select=".//gml:beginPosition/@indeterminatePosition" /> (indeterminatePosition)
224
                        </span>
225
                    </xsl:if>
226
                </div>
227
            </div>
228
        </xsl:if>
229
        <xsl:if test=".//gml:endPosition">
230
            <div class="control-group">
231
                <label class="control-label">End</label>
232
                <div class="controls">
233 10174 mecum
                    <div class="controls-well"><xsl:value-of select=".//gml:endPosition" /></div>
234 10169 mecum
                    <xsl:if test=".//gml:endPosition/@calendarEraName">
235
                        <span>
236
                            <xsl:value-of select=".//gml:endPosition/@calendarEraName" /> (calendarEraName)
237
                        </span>
238
                    </xsl:if>
239
                    <xsl:if test=".//gml:endPosition/@indeterminatePosition">
240
                        <span>
241
                            <xsl:value-of select=".//gml:endPosition/@indeterminatePosition" /> (indeterminatePosition)
242
                        </span>
243
                    </xsl:if>
244
                </div>
245
            </div>
246
        </xsl:if>
247
        <xsl:if test=".//gml:duration">
248
            <span>duration:
249
                <xsl:value-of select=".//gml:duration" />
250
            </span>
251
        </xsl:if>
252
        <xsl:if test=".//gml:timeInterval">
253
            <span>timeInterval:
254
                <xsl:value-of select=".//gml:timeInterval" />
255
            </span>
256
        </xsl:if>
257
    </xsl:template>
258 10049 mecum
259 10169 mecum
    <!-- extentTypeCode -->
260
    <xsl:template match="gmd:extentTypeCode">
261
        <div class="control-group extentTypeCode">
262
            <label class="control-label">Type</label>
263
            <div class="controls">
264
                <xsl:choose>
265
                    <xsl:when test="./gco:Boolean = 0">Exclusive</xsl:when>
266
                    <xsl:when test="./gco:Boolean = 1">Inclusive</xsl:when>
267
                    <xsl:when test="./@nilReason">
268
                        <xsl:value-of select="./@nilReason" />
269
                    </xsl:when>
270
                </xsl:choose>
271
            </div>
272 10049 mecum
        </div>
273 10169 mecum
    </xsl:template>
274 10046 mecum
</xsl:stylesheet>