Project

General

Profile

« Previous | Next » 

Revision 10059

Added by Bryce Mecum about 8 years ago

Continue work on ISO XSLTs

- We now have a template for CI_Citation
- I moved some templates into separate XSLTs
- Cleaned up overally structure/styling of translated output

View differences:

lib/style/skins/metacatui/iso/iso-ci.xsl
278 278
    </xsl:if>
279 279
  </xsl:template>
280 280

  
281
  
281
    <xsl:template match="gmd:CI_Citation">
282
        <div class="control-group">
283
            <label class="control-label">Title</label>
284
            <div class="controls">
285
                <div class="controls-well">
286
                    <xsl:apply-templates select="./gmd:title" />
287
                </div>
288
            </div>
289
        </div>
290

  
291
        <xsl:if test="./gmd:alternateTitle">
292
            <xsl:for-each select="./gmd:alternateTitle">
293
                <div class="control-group">
294
                    <label class="control-label">Alternate Title</label>
295
                    <div class="controls">
296
                        <div class="controls-well">
297
                            <xsl:apply-templates />
298
                        </div>
299
                    </div>
300
                </div>
301
            </xsl:for-each>
302
        </xsl:if>
303

  
304
        <xsl:for-each select="./gmd:date">
305
            <div class="control-group">
306
                <label class="control-label">Date</label>
307
                <div class="controls">
308
                    <div class="controls-well">
309
                        <xsl:apply-templates />
310
                    </div>
311
                </div>
312
            </div>
313
        </xsl:for-each>
314

  
315
        <xsl:if test="./gmd:edition">
316
            <xsl:for-each select="./gmd:edition">
317
                <div class="control-group">
318
                    <label class="control-label">Edition</label>
319
                    <div class="controls">
320
                        <div class="controls-well">
321
                            <xsl:apply-templates />
322
                        </div>
323
                    </div>
324
                </div>
325
            </xsl:for-each>
326
        </xsl:if>
327

  
328
        <xsl:if test="./gmd:editionDate">
329
            <div class="control-group">
330
                <label class="control-label">Edition Date</label>
331
                <div class="controls">
332
                    <div class="controls-well">
333
                        <xsl:apply-templates />
334
                    </div>
335
                </div>
336
            </div>
337
        </xsl:if>
338

  
339
        <xsl:if test="./gmd:identifier">
340
            <xsl:for-each select="./gmd:identifier">
341
                <div class="control-group">
342
                    <label class="control-label">Identifier</label>
343
                    <div class="controls">
344
                        <div class="controls-well">
345
                            <xsl:apply-templates />
346
                        </div>
347
                    </div>
348
                </div>
349
            </xsl:for-each>
350
        </xsl:if>
351

  
352
        <xsl:if test="./gmd:citedResponsibleParty">
353
            <xsl:for-each select="./gmd:citedResponsibleParty">
354
                <div class="control-group">
355
                    <label class="control-label">Cited Responsible Party</label>
356
                    <div class="controls">
357
                        <div class="controls-well">
358
                            <xsl:apply-templates />
359
                        </div>
360
                    </div>
361
                </div>
362
            </xsl:for-each>
363
        </xsl:if>
364

  
365
        <xsl:if test="./gmd:presentationForm">
366
            <xsl:for-each select="./gmd:presentationForm">
367
                <div class="control-group">
368
                    <label class="control-label">Presentation Form</label>
369
                    <div class="controls">
370
                        <div class="controls-well">
371
                            <xsl:apply-templates />
372
                        </div>
373
                    </div>
374
                </div>
375
            </xsl:for-each>
376
        </xsl:if>
377

  
378
        <xsl:if test="./gmd:series">
379
            <div class="control-group">
380
                <label class="control-label">Series</label>
381
                <div class="controls">
382
                    <div class="controls-well">
383
                        <xsl:apply-templates />
384
                    </div>
385
                </div>
386
            </div>
387
        </xsl:if>
388

  
389
        <xsl:if test="./gmd:otherCitationDetails">
390
            <div class="control-group">
391
                <label class="control-label">Other Citation Details</label>
392
                <div class="controls">
393
                    <div class="controls-well">
394
                        <xsl:apply-templates />
395
                    </div>
396
                </div>
397
            </div>
398
        </xsl:if>
399

  
400
        <xsl:if test="./gmd:collectiveTitle">
401
            <div class="control-group">
402
                <label class="control-label">Collective Title</label>
403
                <div class="controls">
404
                    <div class="controls-well">
405
                        <xsl:apply-templates />
406
                    </div>
407
                </div>
408
            </div>
409
        </xsl:if>
410

  
411
        <xsl:if test="./gmd:ISBN">
412
            <div class="control-group">
413
                <label class="control-label">ISBN</label>
414
                <div class="controls">
415
                    <div class="controls-well">
416
                        <xsl:apply-templates />
417
                    </div>
418
                </div>
419
            </div>
420
        </xsl:if>
421

  
422
        <xsl:if test="./gmd:ISSN">
423
            <div class="control-group">
424
                <label class="control-label">ISSN</label>
425
                <div class="controls">
426
                    <div class="controls-well">
427
                        <xsl:apply-templates />
428
                    </div>
429
                </div>
430
            </div>
431
        </xsl:if>
432
    </xsl:template>
282 433
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-ex.xsl
5 5
  xmlns:gco="http://www.isotc211.org/2005/gco" 
6 6
  xmlns:gml="http://www.opengis.net/gml/3.2" version="1.0">
7 7

  
8
  <xsl:output method="html" encoding="UTF-8"
9
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
10
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
11
      indent="yes" />
12

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

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

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

  
9
    <xsl:template match="gco:CharacterString">
10
        <xsl:value-of select="." />
11
    </xsl:template>
12

  
13
    <xsl:template match="gco:Date">
14
        <xsl:value-of select="." />
15
    </xsl:template>
16

  
17
    <xsl:template match="gco:DateTime">
18
        <xsl:value-of select="." />
19
    </xsl:template>
20
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-gmd.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
    <xsl:template match="gmd:URL">
8
        <xsl:variable name="url"><xsl:value-of select="./text()" /></xsl:variable>
9
        <xsl:element name="a">
10
            <xsl:attribute name="href">
11
                <xsl:value-of select="$url" />
12
            </xsl:attribute>
13
            <xsl:value-of select="$url" />
14
        </xsl:element>
15
    </xsl:template>
16
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-gml.xsl
3 3
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 4
        xmlns:gml="http://www.opengis.net/gml/3.2" version="1.0">
5 5

  
6
    <xsl:output method="html" encoding="UTF-8"
7
                doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
8
                doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
9
                indent="yes" />
10

  
11 6
    <xsl:template match="gml:Point">
12 7

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

  
8
    <xsl:template match="gmx:Anchor">
9
        <xsl:element name="a">
10
            <xsl:attribute name="href">
11
                <xsl:value-of select="./@xlink:href" />
12
            </xsl:attribute>
13

  
14
            <!-- Create the attributes for a Bootstrap tooltip to hold the title -->
15
            <xsl:if test="./@xlink:title">
16
                <xsl:attribute name="data-toggle">tooltip</xsl:attribute>
17
                <xsl:attribute name="data-placement">top</xsl:attribute>
18
                <xsl:attribute name="title"><xsl:value-of select="./@xlink:title" /></xsl:attribute>
19
            </xsl:if>
20

  
21
            <xsl:value-of select="./text()" />
22
        </xsl:element>
23
    </xsl:template>
24
</xsl:stylesheet>
lib/style/skins/metacatui/iso/iso-md.xsl
2 2
<xsl:stylesheet
3 3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 4
  xmlns:gmd="http://www.isotc211.org/2005/gmd"
5
  xmlns:gco="http://www.isotc211.org/2005/gco" 
6 5
  version="1.0">
7 6

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

  
11
    <xsl:template match="gmd:MD_TopicCategoryCode">
12
        <xsl:apply-templates />
13
    </xsl:template>
14

  
12 15
  <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>
16
      <table class="table table-condensed">
17
          <thead>
18
              <tr>
19
                  <th>Keyword</th>
20
              </tr>
21
          </thead>
22
          <tbody>
23
              <xsl:for-each select="./gmd:keyword">
24
                  <tr>
25
                    <td><xsl:apply-templates select="." /></td>
26
                  </tr>
27
              </xsl:for-each>
28
          </tbody>
29
      </table>
15 30

  
16
    <ul>
17
      <xsl:for-each select="./gmd:keyword">
18
        <li><xsl:apply-templates select="." /></li>
19
      </xsl:for-each>
20
    </ul>
31
      <xsl:if test="./gmd:type">
32
          <div class="control-group">
33
              <label class="control-label">Type</label>
34
              <div class="controls">
35
                  <div class="controls-well">
36
                      <xsl:value-of select="./gmd:type/gmd:MD_KeywordTypeCode/text()" />
37
                  </div>
38
              </div>
39
          </div>
40
      </xsl:if>
41

  
42
      <div class="control-group">
43
          <label class="control-label">Thesaurus</label>
44
          <div class="controls">
45
              <div class="controls-well">
46
                  <xsl:apply-templates select="./gmd:thesaurusName/gmd:CI_Citation" />
47
              </div>
48
          </div>
49
      </div>
50

  
21 51
  </xsl:template>
52

  
53
    <!-- TODO: gmd:CI_PresentationFormCode-->
54
    <!-- TODO: gmd:CI_Series -->
22 55
</xsl:stylesheet>
lib/style/skins/metacatui/iso/isoroot.xsl
3 3
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4 4
  xmlns:gmd="http://www.isotc211.org/2005/gmd" 
5 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 6
  version="1.0">
10 7

  
8
  <xsl:import href="iso-md.xsl"/>
11 9
  <xsl:import href="iso-ci.xsl"/>
12 10
  <xsl:import href="iso-ex.xsl"/>
13
  <xsl:import href="iso-md.xsl"/>
11
  <xsl:import href="iso-gco.xsl"/>
12
  <xsl:import href="iso-gmd.xsl"/>
13
  <xsl:import href="iso-gml.xsl"/>
14
  <xsl:import href="iso-gmx.xsl"/>
14 15

  
15 16
  <xsl:output method="html" encoding="UTF-8"
16 17
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
......
85 86
            <label class="control-label">Topic Categories</label>
86 87
            <div class="controls">
87 88
              <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>
89
                <table class="table table-condensed">
90
                  <thead>
91
                    <tr>
92
                      <th>Topic</th>
93
                    </tr>
94
                  </thead>
95
                  <tbody>
96
                    <xsl:for-each select="//gmd:topicCategory">
97
                      <tr>
98
                        <td><xsl:apply-templates /></td>
99
                      </tr>
100
                    </xsl:for-each>
101
                  </tbody>
102
                </table>
93 103
              </div>
94 104
            </div>
95 105
          </div>
......
166 176

  
167 177
  <!-- TODO: Figure out how to do this: I want to capture the scenario where
168 178
  an element like gmd:individualName has on child gco:CharacterString or 
169
  equivalent but has a nilReasona attribute. -->
170
  <xsl:template match="@nilReason">
179
  equivalent but has a nilReason attribute. -->
180
  <xsl:template match="*[not(*) and ./@nilReason]">
181
    nilReason!
171 182
    <xsl:value-of select="@nilReason" />
172 183
  </xsl:template>
173

  
174
  <xsl:template match="gco:CharacterString">
175
    <xsl:value-of select="." />
176
  </xsl:template>
177

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

  
184
      <!-- Create the attributes for a Bootstrap tooltip to hold the title -->
185
      <xsl:if test="./@xlink:title">
186
        <xsl:attribute name="data-toggle">tooltip</xsl:attribute>
187
        <xsl:attribute name="data-placement">top</xsl:attribute>
188
        <xsl:attribute name="title"><xsl:value-of select="./@xlink:title" /></xsl:attribute>
189
      </xsl:if>
190

  
191
      <xsl:value-of select="./text()" />
192
    </xsl:element>
193
  </xsl:template>
194

  
195
  <xsl:template match="gmd:URL">
196
    <xsl:variable name="url"><xsl:value-of select="./text()" /></xsl:variable>
197
    <xsl:element name="a">
198
      <xsl:attribute name="href">
199
        <xsl:value-of select="$url" />
200
      </xsl:attribute>
201
      <xsl:value-of select="$url" />
202
    </xsl:element>
203
  </xsl:template>
204 184
</xsl:stylesheet>

Also available in: Unified diff