Project

General

Profile

metacat / lib / style / skins / metacatui / iso19115 / iso-ex.xsl @ 10194

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:gml="http://www.opengis.net/gml/3.2" version="1.0">
7
    <xsl:template match="gmd:EX_Extent">
8
        <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
            </div>
19
        </xsl:if>
20

    
21
        <!-- 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
            </div>
33
        </xsl:for-each>
34

    
35
        <!-- 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
            </div>
45
        </xsl:for-each>
46

    
47
        <!-- 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
            </div>
57
        </xsl:for-each>
58
    </xsl:template>
59

    
60
    <!-- EX_GeographicExtent-->
61
    <xsl:template match="gmd:EX_GeographicExtent">
62
        <xsl:apply-templates />
63
    </xsl:template>
64

    
65
    <!-- EX_BoundingPolygon-->
66
    <xsl:template match="gmd:EX_BoundingPolygon">
67
        <xsl:apply-templates />
68
    </xsl:template>
69

    
70
    <!-- EX_GeographicDescription-->
71
    <xsl:template match="gmd:EX_GeographicDescription">
72
        <xsl:apply-templates />
73
    </xsl:template>
74

    
75
    <!-- 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

    
125
    <!-- 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
        </div>
135
    </xsl:template>
136

    
137
    <!-- EX_TemporalExtent -->
138
    <xsl:template match="gmd:EX_TemporalExtent">
139
        <xsl:apply-templates select=".//gmd:extent/*" />
140
    </xsl:template>
141

    
142
    <!-- 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

    
157
    <!-- TimeInstant-->
158
    <!-- TODO
159
        - Attributes: frame, calendarEraName, indeterminatePosition
160
    -->
161
    <xsl:template match="gml:TimeInstant">
162
        <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
        </div>
203
    </xsl:template>
204

    
205
    <!-- TimePeriod-->
206
    <!-- TODO: 
207
        - All the attributes
208
        - timeInterval units, radix, factor
209
    -->
210
    <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
                    <div class="controls-well"><xsl:value-of select=".//gml:beginPosition" /></div>
216
                    <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
                    <div class="controls-well"><xsl:value-of select=".//gml:endPosition" /></div>
234
                    <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

    
259
    <!-- 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
        </div>
273
    </xsl:template>
274
</xsl:stylesheet>