Project

General

Profile

metacat / lib / style / skins / metacatui / iso19139 / iso-ex.xsl @ 10141

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

    
8
    <xsl:template match="gmd:EX_Extent">
9
      <h4>Extent</h4>
10

    
11
      <!-- description -->
12
      <xsl:if test=".//gmd:description">
13
        <div class="control-group">
14
          <label class="control-label">Description</label>
15
          <div class="controls">
16
            <div class="controls-well">
17
              <xsl:apply-templates />
18
            </div>
19
          </div>
20
        </div>
21
      </xsl:if>
22

    
23
      <!-- Geographic -->
24
      <xsl:for-each select=".//gmd:geographicElement">
25
        <div class="row-fluid geographicCoverage">
26
          <div class="control-group">
27
            <label class="control-label">Geographic</label>
28
            <div class="controls">
29
              <div class="controls-well">
30
                <xsl:apply-templates />
31
              </div>
32
            </div>
33
          </div>
34
        </div>
35
      </xsl:for-each>
36

    
37
      <!-- Temporal -->
38
      <xsl:for-each select=".//gmd:temporalElement">
39
        <div class="control-group">
40
          <label class="control-label">Temporal</label>
41
          <div class="controls">
42
            <div class="controls-well">
43
              <xsl:apply-templates />
44
            </div>
45
          </div>
46
        </div>
47
      </xsl:for-each>
48

    
49
      <!-- Vertical -->
50
      <xsl:for-each select=".//gmd:verticalElement">
51
        <div class="control-group">
52
          <label class="control-label">Vertical</label>
53
          <div class="controls">
54
            <div class="controls-well">
55
              <xsl:apply-templates />
56
            </div>
57
          </div>
58
        </div>
59
      </xsl:for-each>
60
    </xsl:template>
61

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

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

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

    
77

    
78

    
79
  <!-- EX_GeographicBoundingBox-->
80
  <xsl:template match="gmd:EX_GeographicBoundingBox">
81
    <!-- Set up variables for N E S W -->
82
    <xsl:variable name="north"><xsl:value-of select="./gmd:northBoundLatitude/gco:Decimal/text()" /></xsl:variable>
83
    <xsl:variable name="east"><xsl:value-of select="./gmd:eastBoundLongitude/gco:Decimal/text()" /></xsl:variable>
84
    <xsl:variable name="south"><xsl:value-of select="./gmd:southBoundLatitude/gco:Decimal/text()" /></xsl:variable>
85
    <xsl:variable name="west"><xsl:value-of select="./gmd:westBoundLongitude/gco:Decimal/text()" /></xsl:variable>
86

    
87
    <div data-value="{$north}" data-content="northBoundingCoordinate" class="control-group northBoundingCoordinate">
88
      <label class="control-label">North</label>
89
      <div class="controls"><xsl:value-of select="$north" />&#xa0; degrees</div>
90
    </div>
91

    
92
    <div data-value="{$east}" data-content="eastBoundingCoordinate" class="control-group eastBoundingCoordinate">
93
      <label class="control-label">East</label>
94
      <div class="controls"><xsl:value-of select="$east" />&#xa0; degrees</div>
95
    </div>
96

    
97
    <div data-value="{$south}" data-content="southBoundingCoordinate" class="control-group southBoundingCoordinate">
98
      <label class="control-label">South</label>
99
      <div class="controls"><xsl:value-of select="$south" />&#xa0; degrees</div>
100
    </div>
101

    
102
    <div data-value="{$west}" data-content="westBoundingCoordinate" class="control-group westBoundingCoordinate">
103
      <label class="control-label">West</label>
104
      <div class="controls"><xsl:value-of select="$west" />&#xa0; degrees</div>
105
    </div>
106

    
107
    <xsl:apply-templates select="./gmd:extentTypeCode" />
108
  </xsl:template>
109

    
110
  <xsl:template match="gmd:polygon">
111
    <div class="control-group">
112
      <label class="control-label">Polygon</label>
113
      <div class="controls">
114
        <div class="controls-well">
115
          <xsl:apply-templates />
116
        </div>
117
      </div>
118
    </div>
119
  </xsl:template>
120

    
121
  <!-- EX_TemporalExtent -->
122
  <xsl:template match="gmd:EX_TemporalExtent">
123
    <xsl:apply-templates select=".//gmd:extent/*" />
124
  </xsl:template>
125

    
126
  <!-- EX_VerticalExtent-->
127
  <!-- TODO: Improve DOM structure -->
128
  <xsl:template name="verticalextent" match="gmd:EX_VerticalExtent">
129
    <span>minimumValue:     
130
      <xsl:value-of select="./gmd:minimumValue/gco:Real" />
131
    </span>
132
    <span>maximumValue:     
133
      <xsl:value-of select="./gmd:maximumValue/gco:Real" />
134
    </span>
135
    <!-- TODO: Flesh this out a bit more -->
136
    <span>verticalCRS:     
137
      <xsl:value-of select="./gmd:verticalCRS" />
138
    </span>
139
  </xsl:template>
140

    
141
  <!-- TimeInstant-->
142
  <!-- TODO
143
        - Attributes: frame, calendarEraName, indeterminatePosition
144
    -->
145
  <xsl:template name="timeinstant" match="gml:TimeInstant">
146
    <span>time instant</span>
147
    <span>description:             
148
      <xsl:value-of select=".//gmd:description" />
149
    </span>
150
    <span>
151
      <span>timePosition:             
152
        <xsl:value-of select=".//gml:timePosition" />
153
      </span>
154
      <xsl:if test=".//gml:timePosition/@calendarEraName">
155
        <span>
156
          <xsl:value-of select=".//gml:timePosition/@calendarEraName" /> (calendarEraName)
157
        </span>
158
      </xsl:if>
159
      <xsl:if test=".//gml:timePosition/@indeterminatePosition">
160
        <span>
161
          <xsl:value-of select=".//gml:timePosition/@indeterminatePosition" /> (indeterminatePosition)
162
        </span>
163
      </xsl:if>
164
    </span>
165
  </xsl:template>
166

    
167
  <!-- TimePeriod-->
168
  <!-- TODO: 
169
        - All the attributes
170
        - timeInterval units, radix, factor
171
    -->
172
  <xsl:template name="timeperiod" match="gml:TimePeriod">
173

    
174

    
175

    
176

    
177
    <xsl:if test=".//gml:beginPosition">
178
      <div class="control-group">
179
        <label class="control-label">Begin</label>
180
        <div class="controls">
181
          <span><xsl:value-of select=".//gml:beginPosition" /></span>
182
          <xsl:if test=".//gml:beginPosition/@calendarEraName">
183
            <span><xsl:value-of select=".//gml:beginPosition/@calendarEraName" /> (calendarEraName)</span>                        
184
          </xsl:if>
185
          <xsl:if test=".//gml:beginPosition/@indeterminatePosition">
186
            <span><xsl:value-of select=".//gml:beginPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
187
          </xsl:if>
188
        </div>
189
      </div>
190
    </xsl:if>
191

    
192
    <xsl:if test=".//gml:endPosition">
193
      <div class="control-group">
194
        <label class="control-label">End</label>
195
        <div class="controls">
196
          <span><xsl:value-of select=".//gml:endPosition" /></span>
197
          <xsl:if test=".//gml:endPosition/@calendarEraName">
198
            <span><xsl:value-of select=".//gml:endPosition/@calendarEraName" /> (calendarEraName)</span>                        
199
          </xsl:if>
200
          <xsl:if test=".//gml:endPosition/@indeterminatePosition">
201
            <span><xsl:value-of select=".//gml:endPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
202
          </xsl:if>
203
        </div>
204
      </div>
205
    </xsl:if>
206

    
207
    <xsl:if test=".//gml:duration">
208
        <span>duration:         
209
        <xsl:value-of select=".//gml:duration" />
210
      </span>
211
    </xsl:if>
212

    
213
    <xsl:if test=".//gml:timeInterval">
214
      <span>timeInterval:         
215
        <xsl:value-of select=".//gml:timeInterval" />
216
      </span>
217
    </xsl:if>
218
  </xsl:template>
219

    
220
  <!-- extentTypeCode -->
221
  <xsl:template match="gmd:extentTypeCode">
222
    <div class="control-group extentTypeCode">
223
      <label class="control-label">Type</label>
224
      <div class="controls">
225
        <xsl:choose>
226
          <xsl:when test="./gco:Boolean = 0">Exclusion</xsl:when>
227
          <xsl:when test="./gco:Boolean = 1">Inclusion</xsl:when>
228
          <xsl:when test="./@nilReason"><xsl:value-of select="./@nilReason" /></xsl:when>
229
        </xsl:choose>
230
      </div>
231
    </div>
232
  </xsl:template>
233
</xsl:stylesheet>