Project

General

Profile

Revision 10046

Added by Bryce Mecum over 4 years ago

Create first basic version of ISO 19115 XSL stylesheets

View differences:

lib/style/skins/metacatui/iso/iso-ci.xsl
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
  version="1.0">
6

  
7
  <!-- CI_ResponsibleParty -->
8
  <xsl:template name="ci_responsibleparty" match="gmd:CI_ResponsibleParty">
9
    <xsl:if test="./gmd:individualName">
10
      <div class="control-group">
11
        <label class="control-label">Individual</label>
12
        <div class="controls">
13
          <div class="controls-well">
14
            <xsl:apply-templates select="./gmd:individualName/*" />
15
          </div>
16
        </div>
17
      </div>
18
    </xsl:if>
19
    <xsl:if test="./gmd:organisationName">
20
      <div class="control-group">
21
        <label class="control-label">Organization</label>
22
        <div class="controls">
23
          <div class="controls-well">
24
            <xsl:apply-templates select="./gmd:organisationName/*" />
25
          </div>
26
        </div>
27
      </div>
28
    </xsl:if>
29
    <xsl:if test="./gmd:positionName">
30
      <div class="control-group">
31
        <label class="control-label">Position</label>
32
        <div class="controls">
33
          <div class="controls-well">
34
            <xsl:apply-templates select="./gmd:positionName/*" />
35
          </div>
36
        </div>
37
      </div>
38
    </xsl:if>
39
    <xsl:if test="./gmd:role">
40
      <div class="control-group">
41
        <label class="control-label">Role</label>
42
        <div class="controls">
43
          <div class="controls-well">
44
            <xsl:value-of select="./gmd:role/gmd:CI_RoleCode" />
45
          </div>
46
        </div>
47
      </div>
48
    </xsl:if>
49
  </xsl:template>
50
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-ex.xsl
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>
lib/style/skins/metacatui/iso/iso-md.xsl
1
<?xml version="1.0"?>
2
<xsl:stylesheet 
3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
  version="1.0">
5
  
6
  <!-- TODO: This module -->
7
</xsl:stylesheet>
lib/style/skins/metacatui/iso/isoroot.xsl
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:gmx="http://www.isotc211.org/2005/gmx"
7
    xmlns:gml="http://www.opengis.net/gml/3.2" 
8
    xmlns:xlink="http://www.w3.org/1999/xlink"
9
    version="1.0">
10

  
11
    <xsl:import href="iso-ci.xsl"/>
12
    <xsl:import href="iso-ex.xsl"/>
13
    <xsl:import href="iso-md.xsl"/>
14

  
15
    <!-- TODO: Figure out how to set the output method to get what I want -->
16
    <!-- TODO: ^ Figure out what I want to output -->
17
    <!-- TODO: Figuer out what this match statement should have in it -->
18
    <xsl:template match="/">
19

  
20
   	<form class="form-horizontal">
21
        <!-- Dataset title -->
22
        <span><xsl:value-of select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></span>
23

  
24
        <!-- Identifier -->
25
        <div class="control-group">
26
            <label class="control-label">Identifier</label>
27
            <div class="controls">
28
                <div class="controls-well">
29
                    <xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
30
                </div>
31
            </div>
32
        </div>
33

  
34
        <!-- Alternate identifier(s) -->
35
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
36
            <xsl:call-template name="alternateidentifier"/>
37
        </xsl:for-each>
38

  
39
        <!-- Abstract -->
40
        <div class="control-group">
41
            <label class="control-label">Abstract</label>
42
            <div class="controls">
43
                <div class="controls-well">
44
                    <xsl:value-of select="//gmd:abstract/gco:CharacterString/text()" />
45
                </div>
46
            </div>
47
        </div>
48

  
49
        <!--  Topic Categories -->
50
        <div class="control-group">
51
            <label class="control-label">Topic Categories</label>
52
            <div class="controls">
53
                <div class="controls-well">
54
                    <ul>
55
                        <xsl:for-each select="//gmd:topicCategory">
56
                            <li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>                
57
                        </xsl:for-each>
58
                    </ul>
59
                </div>
60
            </div>
61
        </div>
62

  
63
        <!-- Keywords
64

  
65
            Each <gmd:descriptiveKeywords> block should have one or more keywords in it
66
            with one thesaurus. So we render keywords from the same thesaurus together.
67
        -->
68

  
69
        <xsl:for-each select="//gmd:descriptiveKeywords">
70
            <xsl:call-template name="topiccategory"/>
71
        </xsl:for-each>
72

  
73
        <!-- TODO: otherEntities? -->
74

  
75
        <!-- Metadata Contact(s) -->
76
        <div class="control-group">
77
            <label class="control-label">Metadata Contacts</label>
78
            <div class="controls">
79
                <div class="controls-well">
80
                    <xsl:apply-templates select="//gmd:contact" />
81
                </div>
82
            </div>
83
        </div>
84

  
85
        <!-- Data Set Contact(s) -->
86
        <div class="control-group">
87
            <label class="control-label">Data Set Contacts</label>
88
            <div class="controls">
89
                <div class="controls-well">
90
                    <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
91
                </div>
92
            </div>
93
        </div>
94

  
95
        <!-- Cited responsible parties-->
96
        <div class="control-group">
97
            <label class="control-label">Associated Parties</label>
98
            <div class="controls">
99
                <div class="controls-well">
100
                    <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
101
                </div>
102
            </div>
103
        </div>
104

  
105
        <!-- Extent (geographic, temporal, vertical) -->
106
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
107
            <div class="control-group">
108
                <label class="control-label">Extent</label>
109
                <div class="controls">
110
                    <div class="controls-well">
111
                        <xsl:call-template name="extent" />
112
                    </div>
113
                </div>
114
            </div>
115
        </xsl:for-each>
116

  
117
        <!-- TODO Methods -->
118

  
119
        </form>
120
    </xsl:template>
121

  
122
    <!-- General templates that didn't make it into the module-specific 
123
         stylesheets -->
124
    
125
    <!-- Alternate identifier -->
126
    <xsl:template name="alternateidentifier">
127
        <div class="control-group">
128
            <label class="control-label">Alternate Identifier</label>
129
            <div class="controls">
130
                <div class="controls-well">
131
                    <xsl:value-of select="./gmd:MD_Identifier/gmd:code/gmx:Anchor/text()" />
132
                </div>
133
            </div>
134
        </div>
135
    </xsl:template>
136

  
137
    
138
    <!-- Topic Category-->
139
    <!-- 
140
        TODO Type
141
        TODO Thesaurus
142
    -->
143
    <xsl:template name="topiccategory">
144
        <div class="control-group">
145
            <label class="control-label">Topic Categories</label>
146
            <div class="controls">
147
                <div class="controls-well">
148
                    <div>Type: <xsl:value-of select="./gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/text()" /></div>
149

  
150
                    <!-- TODO: The rest of this CI_Citation element -->
151
                    <div>Thesaurus: <xsl:value-of select="./gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></div>
152

  
153
                    <ul>
154
                        <xsl:for-each select="./gmd:MD_Keywords/gmd:keyword">
155
                            <li><xsl:apply-templates select="." /></li>                
156
                        </xsl:for-each>
157
                    </ul>
158
                </div>
159
            </div>
160
        </div>
161
    </xsl:template>
162

  
163
    <!-- Contact -->
164
    <!-- TODO: Role-->
165
    <!-- TODO: ./gmd:contactInfo-->
166
    <xsl:template name="contact">
167
        <xsl:call-template name="ci_responsibleparty" />
168
    </xsl:template>
169

  
170

  
171
    <!-- High level templates -->
172
    
173
    <xsl:template match="gco:CharacterString">
174
        <xsl:value-of select="./text()" />
175
    </xsl:template>
176

  
177
    <xsl:template match="gmx:Anchor">
178
        <xsl:element name="a">
179
            <xsl:attribute name="href">
180
                <xsl:value-of select="./@xlink:href" />
181
            </xsl:attribute>
182
            <xsl:value-of select="./text()" />
183
        </xsl:element>
184
    </xsl:template>
185

  
186
</xsl:stylesheet>

Also available in: Unified diff