Project

General

Profile

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

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
  <!-- EX_BoundingPolygon-->
9
  <!-- TODO: This whole thing -->
10
  <xsl:template name="ex_boundingpolygon" match="gmd:EX_BoundingPolygon">
11
    <xsl:apply-templates />
12
  </xsl:template>
13

    
14
  <!-- EX_Extent-->
15
  <!-- TODO: Convert this to EX_Extent and use apply-templates elsewhere-->
16
  <xsl:template name="extent">
17
    <!-- description -->
18
    <xsl:if test=".//gmd:description">
19
      <div class="control-group">
20
        <label class="control-label">Description</label>
21
        <div class="controls">
22
          <div class="controls-well">
23
            <xsl:value-of select=".//gmd:description/gco:CharacterString/text()" />
24
          </div>
25
        </div>
26
      </div>
27
    </xsl:if>
28

    
29
    <!-- Geographic -->
30
    <xsl:for-each select=".//gmd:geographicElement">
31
      <div class="control-group">
32
        <label class="control-label">Geographic</label>
33
        <div class="controls">
34
          <div class="controls-well">
35
            <xsl:apply-templates />
36
          </div>
37
        </div>
38
      </div>
39
    </xsl:for-each>
40

    
41
    <!-- Temporal -->
42
    <xsl:for-each select=".//gmd:temporalElement">
43
      <div class="control-group">
44
        <label class="control-label">Temporal</label>
45
        <div class="controls">
46
          <div class="controls-well">
47
            <xsl:apply-templates />
48
          </div>
49
        </div>
50
      </div>
51
    </xsl:for-each>
52
    <!-- Vertical -->
53
    <xsl:for-each select=".//gmd:verticalElement">
54
      <div class="control-group">
55
        <label class="control-label">Vertical</label>
56
        <div class="controls">
57
          <div class="controls-well">
58
            <xsl:apply-templates />
59
          </div>
60
        </div>
61
      </div>
62
    </xsl:for-each>
63
  </xsl:template>
64

    
65
  <!-- EX_GeographicBoundingBox-->
66
  <xsl:template name="ex_geographicboundingbox" match="gmd:EX_GeographicBoundingBox">
67
    <span>westBoundingLongitude:     
68
      <xsl:value-of select="./gmd:westBoundLongitude/gco:Decimal" />
69
    </span>
70
    <span>eastBoundLongitude:     
71
      <xsl:value-of select="./gmd:eastBoundLongitude/gco:Decimal" />
72
    </span>
73
    <span>southBoundLatitude:     
74
      <xsl:value-of select="./gmd:southBoundLatitude/gco:Decimal" />
75
    </span>
76
    <span>northBoundLatitude:     
77
      <xsl:value-of select="./gmd:northBoundLatitude/gco:Decimal" />
78
    </span>
79
    <span>
80
      <xsl:apply-templates select="./gmd:extentTypeCode" />
81
    </span>
82
  </xsl:template>
83

    
84
  <!-- EX_GeographicDescription-->
85
  <xsl:template name="ex_geographicdescription" match="gmd:EX_GeographicDescription">
86
    <xsl:apply-templates />
87
  </xsl:template>
88

    
89
  <!-- EX_GeographicExtent-->
90
  <xsl:template name="ex_geographicextent" match="gmd:EX_GeographicExtent">
91
    <xsl:apply-templates />
92
  </xsl:template>
93

    
94
  <!-- EX_TemporalExtent -->
95
  <xsl:template name="ex_temporalextent" match="gmd:EX_TemporalExtent">
96
    <span>temporal extent                
97
      <xsl:apply-templates select=".//gmd:extent/*" />
98
    </span>
99
  </xsl:template>
100

    
101
  <!-- EX_VerticalExtent-->
102
  <!-- TODO: Improve DOM structure -->
103
  <xsl:template name="verticalextent" match="gmd:EX_VerticalExtent">
104
    <span>minimumValue:     
105
      <xsl:value-of select="./gmd:minimumValue/gco:Real" />
106
    </span>
107
    <span>maximumValue:     
108
      <xsl:value-of select="./gmd:maximumValue/gco:Real" />
109
    </span>
110
    <!-- TODO: Flesh this out a bit more -->
111
    <span>verticalCRS:     
112
      <xsl:value-of select="./gmd:verticalCRS" />
113
    </span>
114
  </xsl:template>
115

    
116
  <!-- TimeInstant-->
117
  <!-- TODO
118
        - Attributes: frame, calendarEraName, indeterminatePosition
119
    -->
120
  <xsl:template name="timeinstant" match="gml:TimeInstant">
121
    <span>time instant</span>
122
    <span>description:             
123
      <xsl:value-of select=".//gmd:description" />
124
    </span>
125
    <span>
126
      <span>timePosition:             
127
        <xsl:value-of select=".//gml:timePosition" />
128
      </span>
129
      <xsl:if test=".//gml:timePosition/@calendarEraName">
130
        <span>
131
          <xsl:value-of select=".//gml:timePosition/@calendarEraName" /> (calendarEraName)
132
        </span>
133
      </xsl:if>
134
      <xsl:if test=".//gml:timePosition/@indeterminatePosition">
135
        <span>
136
          <xsl:value-of select=".//gml:timePosition/@indeterminatePosition" /> (indeterminatePosition)
137
        </span>
138
      </xsl:if>
139
    </span>
140
  </xsl:template>
141

    
142
  <!-- TimePeriod-->
143
  <!-- TODO: 
144
        - All the attributes
145
        - timeInterval units, radix, factor
146
    -->
147
  <xsl:template name="timeperiod" match="gml:TimePeriod">
148
    <xsl:if test=".//gml:beginPosition">
149
      <span>beginPosition:         
150
        <xsl:value-of select=".//gml:beginPosition" /></span>
151
        <xsl:if test=".//gml:beginPosition/@calendarEraName">
152
          <span><xsl:value-of select=".//gml:beginPosition/@calendarEraName" /> (calendarEraName)</span>                        
153
        </xsl:if>
154
        <xsl:if test=".//gml:beginPosition/@indeterminatePosition">
155
          <span><xsl:value-of select=".//gml:beginPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
156
        </xsl:if>
157
      </span>
158
    </xsl:if>
159

    
160
    <xsl:if test=".//gml:endPosition">
161
      <span>endPosition:         
162
        <xsl:value-of select=".//gml:endPosition" /></span>
163
        <xsl:if test=".//gml:endPosition/@calendarEraName">
164
          <span><xsl:value-of select=".//gml:endPosition/@calendarEraName" /> (calendarEraName)</span>                         
165
        </xsl:if>
166
        <xsl:if test=".//gml:endPosition/@indeterminatePosition">
167
          <span><xsl:value-of select=".//gml:endPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
168
        </xsl:if>
169
      </span>
170
    </xsl:if>
171

    
172
    <xsl:if test=".//gml:duration">
173
      <span>duration:         
174
        <xsl:value-of select=".//gml:duration" />
175
      </span>
176
    </xsl:if>
177

    
178
    <xsl:if test=".//gml:timeInterval">
179
      <span>timeInterval:         
180
        <xsl:value-of select=".//gml:timeInterval" />
181
      </span>
182
    </xsl:if>
183
  </xsl:template>
184

    
185
  <!-- extentTypeCode -->
186
  <!-- TODO: Work on language. Not sure what I want here.-->
187
  <xsl:template name="gmd_extent_type_code" match="gmd:extentTypeCode">
188
  <span>extentTypeCode:             
189
    <xsl:choose>
190
      <xsl:when test="./gco:Boolean = 0"><span>Exclusion<span></xsl:when>
191
      <xsl:when test="./gco:Boolean = 1"><span>Inclusion<span></xsl:when>
192
    </xsl:choose>
193
    </span>
194
  </xsl:template>
195
</xsl:stylesheet>