Project

General

Profile

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

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
        <span>time instant</span>
163
        <span>description:
164
            <xsl:value-of select=".//gmd:description" />
165
        </span>
166
        <div>
167
            <span>timePosition:
168
                <xsl:value-of select=".//gml:timePosition" />
169
            </span>
170
            <xsl:if test=".//gml:timePosition/@calendarEraName">
171
                <span>
172
                    <xsl:value-of select=".//gml:timePosition/@calendarEraName" /> (calendarEraName)
173
                </span>
174
            </xsl:if>
175
            <xsl:if test=".//gml:timePosition/@indeterminatePosition">
176
                <span>
177
                    <xsl:value-of select=".//gml:timePosition/@indeterminatePosition" /> (indeterminatePosition)
178
                </span>
179
            </xsl:if>
180
        </div>
181
    </xsl:template>
182

    
183
    <!-- TimePeriod-->
184
    <!-- TODO: 
185
        - All the attributes
186
        - timeInterval units, radix, factor
187
    -->
188
    <xsl:template match="gml:TimePeriod">
189
        <xsl:if test=".//gml:beginPosition">
190
            <div class="control-group">
191
                <label class="control-label">Begin</label>
192
                <div class="controls">
193
                    <span>
194
                        <xsl:value-of select=".//gml:beginPosition" />
195
                    </span>
196
                    <xsl:if test=".//gml:beginPosition/@calendarEraName">
197
                        <span>
198
                            <xsl:value-of select=".//gml:beginPosition/@calendarEraName" /> (calendarEraName)
199
                        </span>
200
                    </xsl:if>
201
                    <xsl:if test=".//gml:beginPosition/@indeterminatePosition">
202
                        <span>
203
                            <xsl:value-of select=".//gml:beginPosition/@indeterminatePosition" /> (indeterminatePosition)
204
                        </span>
205
                    </xsl:if>
206
                </div>
207
            </div>
208
        </xsl:if>
209
        <xsl:if test=".//gml:endPosition">
210
            <div class="control-group">
211
                <label class="control-label">End</label>
212
                <div class="controls">
213
                    <span>
214
                        <xsl:value-of select=".//gml:endPosition" />
215
                    </span>
216
                    <xsl:if test=".//gml:endPosition/@calendarEraName">
217
                        <span>
218
                            <xsl:value-of select=".//gml:endPosition/@calendarEraName" /> (calendarEraName)
219
                        </span>
220
                    </xsl:if>
221
                    <xsl:if test=".//gml:endPosition/@indeterminatePosition">
222
                        <span>
223
                            <xsl:value-of select=".//gml:endPosition/@indeterminatePosition" /> (indeterminatePosition)
224
                        </span>
225
                    </xsl:if>
226
                </div>
227
            </div>
228
        </xsl:if>
229
        <xsl:if test=".//gml:duration">
230
            <span>duration:
231
                <xsl:value-of select=".//gml:duration" />
232
            </span>
233
        </xsl:if>
234
        <xsl:if test=".//gml:timeInterval">
235
            <span>timeInterval:
236
                <xsl:value-of select=".//gml:timeInterval" />
237
            </span>
238
        </xsl:if>
239
    </xsl:template>
240

    
241
    <!-- extentTypeCode -->
242
    <xsl:template match="gmd:extentTypeCode">
243
        <div class="control-group extentTypeCode">
244
            <label class="control-label">Type</label>
245
            <div class="controls">
246
                <xsl:choose>
247
                    <xsl:when test="./gco:Boolean = 0">Exclusive</xsl:when>
248
                    <xsl:when test="./gco:Boolean = 1">Inclusive</xsl:when>
249
                    <xsl:when test="./@nilReason">
250
                        <xsl:value-of select="./@nilReason" />
251
                    </xsl:when>
252
                </xsl:choose>
253
            </div>
254
        </div>
255
    </xsl:template>
256
</xsl:stylesheet>