Project

General

Profile

« Previous | Next » 

Revision 10056

Continue work on ISO XSLT

- Cleans up the root element to better match what we want in the end (looks like the EML XSLT)
- Switches a lot of calls to call-template over to apply-templates. I think this is a good idea because the ISO standards use XSD type equivalence to extend existing schemas. e.g., gmx:Anchors can show up when the gmd schema says only a gco:CharacterString should go there
- Adds support for a lot more element types
- Cleans up indentation. I'm probably going to want to change this later but oh well. At least it's the same across files. Sorry if you don't like two-space soft tabs.
- Removes numerous unused templates and puts some into the iso-md XSLT which should probably get called something else anyways

View differences:

lib/style/skins/metacatui/iso/iso-ci.xsl
1 1
<?xml version="1.0"?>
2 2
<xsl:stylesheet 
3 3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4
  xmlns:gmd="http://www.isotc211.org/2005/gmd" 
4
  xmlns:gmd="http://www.isotc211.org/2005/gmd"
5
  xmlns:gco="http://www.isotc211.org/2005/gco" 
5 6
  version="1.0">
6 7

  
7 8
  <!-- CI_ResponsibleParty -->
8
  <xsl:template name="ci_responsibleparty" match="gmd:CI_ResponsibleParty">
9
    <xsl:if test="./gmd:individualName">
9
  <xsl:template match="gmd:CI_ResponsibleParty">
10
    <div class="controls-well">
11
      <xsl:if test="./gmd:individualName">
12
        <div class="control-group">
13
          <label class="control-label">Individual</label>
14
          <div class="controls">
15
            <div class="controls-well">
16
              <xsl:apply-templates select="./gmd:individualName" />
17
            </div>
18
          </div>
19
        </div>
20
      </xsl:if>
21

  
22
      <xsl:if test="./gmd:organisationName">
23
        <div class="control-group">
24
          <label class="control-label">Organization</label>
25
          <div class="controls">
26
            <div class="controls-well">
27
              <xsl:apply-templates select="./gmd:organisationName" />
28
            </div>
29
          </div>
30
        </div>
31
      </xsl:if>
32

  
33
      <xsl:if test="./gmd:positionName">
34
        <div class="control-group">
35
          <label class="control-label">Position</label>
36
          <div class="controls">
37
            <div class="controls-well">
38
              <xsl:apply-templates select="./gmd:positionName" />
39
            </div>
40
          </div>
41
        </div>
42
      </xsl:if>
43

  
44
      <xsl:if test="./gmd:contactInfo/gmd:CI_Contact/gmd:phone">
45
        <div class="control-group">
46
          <label class="control-label">Phone</label>
47
          <div class="controls">
48
            <div class="controls-well">
49
              <xsl:apply-templates select="./gmd:contactInfo/gmd:CI_Contact/gmd:phone" />
50
            </div>
51
          </div>
52
        </div>
53
      </xsl:if>
54

  
55
      <xsl:if test="./gmd:contactInfo/gmd:CI_Contact/gmd:address">
56
        <div class="control-group">
57
          <label class="control-label">Address</label>
58
          <div class="controls">
59
            <div class="controls-well">
60
              <xsl:apply-templates select="./gmd:contactInfo/gmd:CI_Contact/gmd:address" />
61
            </div>
62
          </div>
63
        </div>
64
      </xsl:if>
65

  
66
      <xsl:if test="./gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource">
67
        <div class="control-group">
68
          <label class="control-label">Online Resource</label>
69
          <div class="controls">
70
            <div class="controls-well">
71
              <xsl:apply-templates select="./gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource" />
72
            </div>
73
          </div>
74
        </div>
75
      </xsl:if>
76

  
77
      <xsl:if test="./gmd:contactInfo/gmd:CI_Contact/gmd:hoursOfService">
78
        <div class="control-group">
79
          <label class="control-label">Hours of Service</label>
80
          <div class="controls">
81
            <div class="controls-well">
82
              <xsl:apply-templates select="./gmd:contactInfo/gmd:CI_Contact/gmd:hoursOfService" />
83
            </div>
84
          </div>
85
        </div>
86
      </xsl:if>
87

  
88
      <xsl:if test="./gmd:contactInfo/gmd:CI_Contact/gmd:contactInstructions">
89
        <div class="control-group">
90
          <label class="control-label">Contact Instructions</label>
91
          <div class="controls">
92
            <div class="controls-well">
93
              <xsl:apply-templates select="./gmd:contactInfo/gmd:CI_Contact/gmd:contactInstructions" />
94
            </div>
95
          </div>
96
        </div>
97
      </xsl:if>
98

  
99
      <xsl:if test="./gmd:role">
100
        <div class="control-group">
101
          <label class="control-label">Role</label>
102
          <div class="controls">
103
            <div class="controls-well">
104
              <xsl:apply-templates select="./gmd:role" />
105
            </div>
106
          </div>
107
        </div>
108
      </xsl:if>
109
    </div>
110
  </xsl:template>
111

  
112
  <xsl:template match="gmd:CI_RoleCode">
113
    <xsl:apply-templates />
114
  </xsl:template>
115
  
116
  <xsl:template match="gmd:CI_Telephone">
117
    <xsl:for-each select="./gmd:voice">
10 118
      <div class="control-group">
11
        <label class="control-label">Individual</label>
119
          <label class="control-label">Voice</label>
120
          <div class="controls">
121
            <div class="controls-well">
122
              <xsl:apply-templates />
123
            </div>
124
          </div>
125
        </div>
126
    </xsl:for-each>
127

  
128
    <xsl:for-each select="./gmd:facsimile">
129
      <div class="control-group">
130
          <label class="control-label">Fax</label>
131
          <div class="controls">
132
            <div class="controls-well">
133
              <xsl:apply-templates />
134
            </div>
135
          </div>
136
        </div>
137
    </xsl:for-each>
138
  </xsl:template>
139
  
140
  <xsl:template match="gmd:CI_Address">
141
    <xsl:for-each select="./gmd:deliveryPoint">
142
      <div class="control-group">
143
          <label class="control-label">Delivery Point</label>
144
          <div class="controls">
145
            <div class="controls-well">
146
              <xsl:apply-templates />
147
            </div>
148
          </div>
149
        </div>
150
    </xsl:for-each>
151

  
152
    <xsl:if test="./gmd:city">
153
      <div class="control-group">
154
        <label class="control-label">City</label>
12 155
        <div class="controls">
13 156
          <div class="controls-well">
14
            <xsl:apply-templates select="./gmd:individualName/*" />
157
            <xsl:apply-templates select="./gmd:city" />
15 158
          </div>
16 159
        </div>
17 160
      </div>
18 161
    </xsl:if>
19
    <xsl:if test="./gmd:organisationName">
162

  
163
    <xsl:if test="./gmd:administrativeArea">
20 164
      <div class="control-group">
21
        <label class="control-label">Organization</label>
165
        <label class="control-label">Administrative Area</label>
22 166
        <div class="controls">
23 167
          <div class="controls-well">
24
            <xsl:apply-templates select="./gmd:organisationName/*" />
168
            <xsl:apply-templates select="./gmd:administrativeArea" />
25 169
          </div>
26 170
        </div>
27 171
      </div>
28 172
    </xsl:if>
29
    <xsl:if test="./gmd:positionName">
173
    
174
    <xsl:if test="./gmd:postalCode">
30 175
      <div class="control-group">
31
        <label class="control-label">Position</label>
176
        <label class="control-label">Postal Code</label>
32 177
        <div class="controls">
33 178
          <div class="controls-well">
34
            <xsl:apply-templates select="./gmd:positionName/*" />
179
            <xsl:apply-templates select="./gmd:postalCode" />
35 180
          </div>
36 181
        </div>
37 182
      </div>
38 183
    </xsl:if>
39
    <xsl:if test="./gmd:role">
184
    
185
    <xsl:if test="./gmd:country">
40 186
      <div class="control-group">
41
        <label class="control-label">Role</label>
187
        <label class="control-label">Country</label>
42 188
        <div class="controls">
43 189
          <div class="controls-well">
44
            <xsl:value-of select="./gmd:role/gmd:CI_RoleCode" />
190
            <xsl:apply-templates select="./gmd:country" />
45 191
          </div>
46 192
        </div>
47 193
      </div>
48 194
    </xsl:if>
195

  
196
    <xsl:for-each select="./gmd:electronicMailAddress">
197
      <div class="control-group">
198
          <label class="control-label">E-Mail</label>
199
          <div class="controls">
200
            <div class="controls-well">
201

  
202
              <xsl:variable name="email" select="./gco:CharacterString/text()" />
203
              <xsl:element name="a">
204
                <xsl:attribute name="href">mailto:<xsl:value-of select="$email" /></xsl:attribute>
205
                <xsl:value-of select="$email" />
206
              </xsl:element>
207
            </div>
208
          </div>
209
        </div>
210
    </xsl:for-each>
49 211
  </xsl:template>
212

  
213
  <xsl:template match="gmd:CI_OnlineResource">
214
    <xsl:if test="./gmd:linkage">
215
      <div class="control-group">
216
        <label class="control-label">linkage</label>
217
        <div class="controls">
218
          <div class="controls-well">
219
            <xsl:apply-templates select="./gmd:linkage" />
220
          </div>
221
        </div>
222
      </div>
223
    </xsl:if>
224

  
225
    <xsl:if test="./gmd:protocol">
226
      <div class="control-group">
227
        <label class="control-label">protocol</label>
228
        <div class="controls">
229
          <div class="controls-well">
230
            <xsl:apply-templates select="./gmd:protocol" />
231
          </div>
232
        </div>
233
      </div>
234
    </xsl:if>
235

  
236
    <xsl:if test="./gmd:applicationProfile">
237
      <div class="control-group">
238
        <label class="control-label">applicationProfile</label>
239
        <div class="controls">
240
          <div class="controls-well">
241
            <xsl:apply-templates select="./gmd:applicationProfile" />
242
          </div>
243
        </div>
244
      </div>
245
    </xsl:if>
246

  
247
    <xsl:if test="./gmd:name">
248
      <div class="control-group">
249
        <label class="control-label">name</label>
250
        <div class="controls">
251
          <div class="controls-well">
252
            <xsl:apply-templates select="./gmd:name" />
253
          </div>
254
        </div>
255
      </div>
256
    </xsl:if>
257

  
258
    <xsl:if test="./gmd:description">
259
      <div class="control-group">
260
        <label class="control-label">description</label>
261
        <div class="controls">
262
          <div class="controls-well">
263
            <xsl:apply-templates select="./gmd:description" />
264
          </div>
265
        </div>
266
      </div>
267
    </xsl:if>
268

  
269
    <xsl:if test="./gmd:function">
270
      <div class="control-group">
271
        <label class="control-label">function</label>
272
        <div class="controls">
273
          <div class="controls-well">
274
            <xsl:apply-templates select="./gmd:function" />
275
          </div>
276
        </div>
277
      </div>
278
    </xsl:if>
279
  </xsl:template>
280

  
281
  
50 282
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-ex.xsl
200 200
    </xsl:if>
201 201

  
202 202
    <xsl:if test=".//gml:duration">
203
      <span>duration:         
203
        <span>duration:         
204 204
        <xsl:value-of select=".//gml:duration" />
205 205
      </span>
206 206
    </xsl:if>
lib/style/skins/metacatui/iso/iso-md.xsl
1 1
<?xml version="1.0"?>
2
<xsl:stylesheet 
2
<xsl:stylesheet
3 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" 
4 6
  version="1.0">
5
  
6
  <!-- TODO: This module -->
7

  
8
  <xsl:template match="gmd:MD_Identifier">
9
    <xsl:apply-templates select="./gmd:code" />
10
  </xsl:template>
11

  
12
  <xsl:template match="gmd:MD_Keywords">
13
    <div><strong>Type:</strong>&#xa0;<xsl:value-of select="./gmd:type/gmd:MD_KeywordTypeCode/text()" /></div>
14
    <div><strong>Thesaurus:&#xa0;</strong><xsl:value-of select="./gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></div>
15

  
16
    <ul>
17
      <xsl:for-each select="./gmd:keyword">
18
        <li><xsl:apply-templates select="." /></li>
19
      </xsl:for-each>
20
    </ul>
21
  </xsl:template>
7 22
</xsl:stylesheet>
lib/style/skins/metacatui/iso/isoroot.xsl
1 1
<?xml version="1.0"?>
2 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">
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 10

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

  
15
    <xsl:output method="html" encoding="UTF-8"
16
        doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
17
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
18
        indent="yes" />  
15
  <xsl:output method="html" encoding="UTF-8"
16
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
17
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
18
      indent="yes" />  
19 19

  
20
    <!-- TODO: Figure out how to set the output method to get what I want -->
21
    <!-- TODO: ^ Figure out what I want to output -->
22
    <!-- TODO: Figuer out what this match statement should have in it -->
23
    <xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']">
24
        <form class="form-horizontal">
25
            <!-- Dataset title -->
26
            <div class="control-group">
27
                <label class="control-label">Identifier</label>
28
                <div class="controls">
29
                    <div class="controls-well">
30
                        <xsl:value-of select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" />
31
                    </div>
32
                </div>
20
  <!-- TODO: Figure out how to set the output method to get what I want -->
21
  <!-- TODO: ^ Figure out what I want to output -->
22
  <!-- TODO: Figuer out what this match statement should have in it -->
23
  <!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification -->
24

  
25
  <xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']">
26
    <form class="form-horizontal">
27
      <div class="control-group entity">
28
        <h4>General</h4>
29
        <!-- fileIdentifier 1:1 -->
30
        <div class="control-group">
31
          <label class="control-label">Identifier</label>
32
          <div class="controls">
33
            <div class="controls-well">
34
                <xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
33 35
            </div>
36
          </div>
37
        </div>
34 38

  
35
            <!-- Identifier -->
36
            <div class="control-group">
37
                <label class="control-label">Identifier</label>
38
                <div class="controls">
39
                    <div class="controls-well">
40
                        <xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
41
                    </div>
42
                </div>
39
        <!-- TODO: language 1:1 -->
40
        <!-- TODO: characterSet 1:1 -->
41
        
42
        <!-- Parent Identifier 1:1 conditional -->
43
        <xsl:if test="//gmd:parentIdentifier">
44
          <div class="control-group">
45
            <label class="control-label">Parent Identifier</label>
46
            <div class="controls">
47
              <div class="controls-well">
48
                <xsl:value-of select="//gmd:parentIdentifier/gco:CharacterString/text()" />
49
              </div>
43 50
            </div>
51
          </div>
52
        </xsl:if>
44 53

  
45
            <!-- Alternate identifier(s) -->
46
            <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
47
                <xsl:call-template name="alternateidentifier"/>
48
            </xsl:for-each>
54
        <!-- TODO: hierarchyLevel 0:inf -->
55
        <!-- TODO: hierarchyLevelName 0:inf -->
49 56

  
50
            <!-- Abstract -->
51
            <div class="control-group">
52
                <label class="control-label">Abstract</label>
53
                <div class="controls">
54
                    <div class="controls-well">
55
                        <xsl:value-of select="//gmd:abstract/gco:CharacterString/text()" />
56
                    </div>
57
                </div>
57
        <!-- Alternate identifier(s) 0:inf-->
58
        <!-- gmd:identifier is an optional aprt of the CI_Citation element -->
59
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
60
          <div class="control-group">
61
            <label class="control-label">Cited Identifier</label>
62
            <div class="controls">
63
              <div class="controls-well">
64
                <xsl:apply-templates />
65
              </div>
58 66
            </div>
67
          </div>
68
        </xsl:for-each>
59 69

  
60
            <!--  Topic Categories -->
61
            <xsl:if test="//gmd:topicCategory">
62
                <div class="control-group">
63
                    <label class="control-label">Topic Categories</label>
64
                    <div class="controls">
65
                        <div class="controls-well">
66
                            <ul>
67
                                <xsl:for-each select="//gmd:topicCategory">
68
                                    <li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>                
69
                                </xsl:for-each>
70
                            </ul>
71
                        </div>
72
                    </div>
73
                </div>
74
            </xsl:if>
75
            
70
        <!-- Abstract 1:inf-->
71
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
72
          <div class="control-group">
73
            <label class="control-label">Abstract</label>
74
            <div class="controls">
75
              <div class="controls-well">
76
                <xsl:apply-templates />
77
              </div>
78
            </div>
79
          </div>
80
        </xsl:for-each>
76 81

  
77
            <!-- Keywords
82
        <!--  Topic Categories -->
83
        <xsl:if test="//gmd:topicCategory">
84
          <div class="control-group">
85
            <label class="control-label">Topic Categories</label>
86
            <div class="controls">
87
              <div class="controls-well">
88
                <ul>
89
                  <xsl:for-each select="//gmd:topicCategory">
90
                    <li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>                
91
                  </xsl:for-each>
92
                </ul>
93
              </div>
94
            </div>
95
          </div>
96
        </xsl:if>
97
    
98
        <!-- Keywords
78 99

  
79
                Each <gmd:descriptiveKeywords> block should have one or more keywords in it
80
                with one thesaurus. So we render keywords from the same thesaurus together.
81
            -->
100
            Each <gmd:descriptiveKeywords> block should have one or more keywords in it
101
            with one thesaurus. So we render keywords from the same thesaurus together.
102
        -->
103
        <xsl:if test="//gmd:descriptiveKeywords">
104
          <div class="control-group">
105
            <label class="control-label">Descriptive Keywords</label>
106
            <div class="controls">
107
              <div class="controls-well">
108
                <xsl:for-each select="//gmd:descriptiveKeywords">
109
                  <xsl:apply-templates />
110
                </xsl:for-each>
111
              </div>
112
            </div>
113
          </div>
114
        </xsl:if>
115
      </div>
82 116

  
83
            
84
            <xsl:if test="//gmd:descriptiveKeywords">
85
                <div class="control-group">
86
                    <label class="control-label">Descriptive Keywords</label>
87
                    <div class="controls">
88
                        <div class="controls-well">
89
                            <xsl:for-each select="//gmd:descriptiveKeywords">
90
                                <xsl:call-template name="descriptive_keywords"/>
91
                            </xsl:for-each>
92
                        </div>
93
                    </div>
94
                </div>
95
            </xsl:if>
96
            
117
      <div class="control-group entity">
118
        <h4>People and Associated Parties</h4>
97 119

  
98
            <!-- TODO: otherEntities? -->
99

  
100
            <!-- Metadata Contact(s) -->
101
            <div class="control-group">
102
                <label class="control-label">Metadata Contacts</label>
103
                <div class="controls">
104
                    <div class="controls-well">
105
                        <xsl:apply-templates select="//gmd:contact" />
106
                    </div>
107
                </div>
120
        <!-- Metadata Contact(s) 1:inf -->
121
        <div class="control-group">
122
          <label class="control-label">Metadata Contact(s)</label>
123
          <div class="controls">
124
            <div class="controls-well">
125
              <xsl:for-each select="//gmd:contact">
126
                <xsl:apply-templates />
127
              </xsl:for-each>
108 128
            </div>
129
          </div>
130
        </div>
109 131

  
110
            <!-- Data Set Contact(s) -->
111
            <div class="control-group">
112
                <label class="control-label">Data Set Contacts</label>
113
                <div class="controls">
114
                    <div class="controls-well">
115
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
116
                    </div>
117
                </div>
132
        <!-- Data Set Contact(s) -->
133
        <div class="control-group">
134
          <label class="control-label">Data Set Contacts</label>
135
          <div class="controls">
136
            <div class="controls-well">
137
              <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
118 138
            </div>
139
          </div>
140
        </div>
119 141

  
120
            <!-- Cited responsible parties-->
121
            <div class="control-group">
122
                <label class="control-label">Associated Parties</label>
123
                <div class="controls">
124
                    <div class="controls-well">
125
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
126
                    </div>
127
                </div>
142
        <!-- Cited responsible parties-->
143
        <div class="control-group">
144
          <label class="control-label">Associated Parties</label>
145
          <div class="controls">
146
            <div class="controls-well">
147
              <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
128 148
            </div>
149
          </div>
150
        </div>
151
      </div>
129 152

  
130
            <!-- Extent (geographic, temporal, vertical) -->
131
            <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
132
                <div class="control-group">
133
                    <label class="control-label">Extent</label>
134
                    <div class="controls">
135
                        <div class="controls-well">
136
                            <xsl:call-template name="extent" />
137
                        </div>
138
                    </div>
139
                </div>
140
            </xsl:for-each>
153
      <!-- TODO: otherEntities? -->
141 154

  
142
            <!-- TODO Methods -->
143

  
144
        </form>
145
    </xsl:template>
146

  
147
    <!-- General templates that didn't make it into the module-specific 
148
         stylesheets -->
149
    
150
    <!-- Alternate identifier -->
151
    <xsl:template name="alternateidentifier">
152
        <div class="control-group">
153
            <label class="control-label">Alternate Identifier</label>
155
      <!-- Extent (geographic, temporal, vertical) -->
156
      <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
157
        <div class="control-group entity">
158
          <h4>Extent</h4>
159
          <div class="control-group">
160
            <label class="control-label">Extent</label>
154 161
            <div class="controls">
155
                <div class="controls-well">
156
                    <xsl:value-of select="./gmd:MD_Identifier/gmd:code/gmx:Anchor/text()" />
157
                </div>
162
              <div class="controls-well">
163
                <xsl:call-template name="extent" />
164
              </div>
158 165
            </div>
166
          </div>
159 167
        </div>
160
    </xsl:template>
168
      </xsl:for-each>
161 169

  
162
    
163
    <!-- descriptiveKewords -->
164
    <xsl:template name="descriptive_keywords">
165
        <div><strong>Type:</strong>&#xa0;<xsl:value-of select="./gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/text()" /></div>
166
        <div><strong>Thesaurus:&#xa0;</strong><xsl:value-of select="./gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></div>
170
      <!-- TODO Methods -->
167 171

  
168
        <ul>
169
            <xsl:for-each select="./gmd:MD_Keywords/gmd:keyword">
170
                <li><xsl:apply-templates select="." /></li>                
171
            </xsl:for-each>
172
        </ul>
173
    </xsl:template>
172
    </form>
173
  </xsl:template>
174 174

  
175
    <!-- Contact -->
176
    <!-- TODO: Role-->
177
    <!-- TODO: ./gmd:contactInfo-->
178
    <xsl:template name="contact">
179
        <xsl:call-template name="ci_responsibleparty" />
180
    </xsl:template>
175
  <!-- General, high-level templates -->
181 176

  
177
  <!-- TODO: Figure out how to do this: I want to capture the scenario where
178
  an element like gmd:individualName has on child gco:CharacterString or 
179
  equivalent but has a nilReasona attribute. -->
180
  <xsl:template match="@nilReason">
181
    <xsl:value-of select="@nilReason" />
182
  </xsl:template>
182 183

  
183
    <!-- High level templates -->
184
    
185
    <xsl:template match="gco:CharacterString">
186
        <xsl:value-of select="./text()" />
187
    </xsl:template>
184
  <xsl:template match="gco:CharacterString">
185
    <xsl:value-of select="." />
186
  </xsl:template>
188 187

  
189
    <xsl:template match="gmx:Anchor">
190
        <xsl:element name="a">
191
            <xsl:attribute name="href">
192
                <xsl:value-of select="./@xlink:href" />
193
            </xsl:attribute>
194
            <xsl:value-of select="./text()" />
195
        </xsl:element>
196
    </xsl:template>
188
  <xsl:template match="gmx:Anchor">
189
    <xsl:element name="a">
190
      <xsl:attribute name="href">
191
        <xsl:value-of select="./@xlink:href" />
192
      </xsl:attribute>
197 193

  
194
      <!-- Create the attributes for a Bootstrap tooltip to hold the title -->
195
      <xsl:if test="./@xlink:title">
196
        <xsl:attribute name="data-toggle">tooltip</xsl:attribute>
197
        <xsl:attribute name="data-placement">top</xsl:attribute>
198
        <xsl:attribute name="title"><xsl:value-of select="./@xlink:title" /></xsl:attribute>
199
      </xsl:if>
200

  
201
      <xsl:value-of select="./text()" />
202
    </xsl:element>
203
  </xsl:template>
204

  
205
  <xsl:template match="gmd:URL">
206
    <xsl:variable name="url"><xsl:value-of select="./text()" /></xsl:variable>
207
    <xsl:element name="a">
208
      <xsl:attribute name="href">
209
        <xsl:value-of select="$url" />
210
      </xsl:attribute>
211
      <xsl:value-of select="$url" />
212
    </xsl:element>
213
  </xsl:template>
198 214
</xsl:stylesheet>

Also available in: Unified diff