Project

General

Profile

« Previous | Next » 

Revision 10049

Added by Bryce Mecum over 7 years ago

Improve output of ISO XSLT

View differences:

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

  
8 13
  <!-- EX_BoundingPolygon-->
9 14
  <!-- TODO: This whole thing -->
10 15
  <xsl:template name="ex_boundingpolygon" match="gmd:EX_BoundingPolygon">
......
49 54
        </div>
50 55
      </div>
51 56
    </xsl:for-each>
57

  
52 58
    <!-- Vertical -->
53 59
    <xsl:for-each select=".//gmd:verticalElement">
54 60
      <div class="control-group">
......
64 70

  
65 71
  <!-- EX_GeographicBoundingBox-->
66 72
  <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>
73
  	<xsl:variable name="north"><xsl:value-of select="./gmd:northBoundLongitude/gco:Decimal" /></xsl:variable>
74
  	<xsl:variable name="east"><xsl:value-of select="./gmd:eastBoundLongitude/gco:Decimal" /></xsl:variable>
75
  	<xsl:variable name="south"><xsl:value-of select="./gmd:southBoundLongitude/gco:Decimal" /></xsl:variable>
76
  	<xsl:variable name="west"><xsl:value-of select="./gmd:westBoundLongitude/gco:Decimal" /></xsl:variable>
77

  
78

  
79
    <div data-value="{$north}" data-content="northBoundingCoordinate" class="control-group northBoundingCoordinate">
80
      <label class="control-label">North</label>
81
      <div class="controls"><xsl:value-of select="$north" />&#xa0; degrees</div>
82
    </div>
83

  
84
    <div data-value="{$east}" data-content="eastBoundingCoordinate" class="control-group eastBoundingCoordinate">
85
      <label class="control-label">East</label>
86
      <div class="controls"><xsl:value-of select="$east" />&#xa0; degrees</div>
87
    </div>
88

  
89
    <div data-value="{$south}" data-content="southBoundingCoordinate" class="control-group southBoundingCoordinate">
90
      <label class="control-label">South</label>
91
      <div class="controls"><xsl:value-of select="$south" />&#xa0; degrees</div>
92
    </div>
93

  
94
    <div data-value="{$west}" data-content="westBoundingCoordinate" class="control-group westBoundingCoordinate">
95
      <label class="control-label">West</label>
96
      <div class="controls"><xsl:value-of select="$west" />&#xa0; degrees</div>
97
    </div>
98

  
79 99
    <span>
80 100
      <xsl:apply-templates select="./gmd:extentTypeCode" />
81 101
    </span>
......
145 165
        - timeInterval units, radix, factor
146 166
    -->
147 167
  <xsl:template name="timeperiod" match="gml:TimePeriod">
168

  
169

  
170

  
171

  
148 172
    <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>
173
      <div class="control-group">
174
        <label class="control-label">Begin</label>
175
        <div class="controls">
176
          <span><xsl:value-of select=".//gml:beginPosition" /></span>
177
          <xsl:if test=".//gml:beginPosition/@calendarEraName">
178
            <span><xsl:value-of select=".//gml:beginPosition/@calendarEraName" /> (calendarEraName)</span>                        
179
          </xsl:if>
180
          <xsl:if test=".//gml:beginPosition/@indeterminatePosition">
181
            <span><xsl:value-of select=".//gml:beginPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
182
          </xsl:if>
183
        </div>
184
      </div>
158 185
    </xsl:if>
159 186

  
160 187
    <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>
188
      <div class="control-group">
189
        <label class="control-label">End</label>
190
        <div class="controls">
191
          <span><xsl:value-of select=".//gml:endPosition" /></span>
192
          <xsl:if test=".//gml:endPosition/@calendarEraName">
193
            <span><xsl:value-of select=".//gml:endPosition/@calendarEraName" /> (calendarEraName)</span>                        
194
          </xsl:if>
195
          <xsl:if test=".//gml:endPosition/@indeterminatePosition">
196
            <span><xsl:value-of select=".//gml:endPosition/@indeterminatePosition" /> (indeterminatePosition)</span>                        
197
          </xsl:if>
198
        </div>
199
      </div>
170 200
    </xsl:if>
171 201

  
172 202
    <xsl:if test=".//gml:duration">
......
185 215
  <!-- extentTypeCode -->
186 216
  <!-- TODO: Work on language. Not sure what I want here.-->
187 217
  <xsl:template name="gmd_extent_type_code" match="gmd:extentTypeCode">
188
  <span>extentTypeCode:             
218
  <span>extentTypeCode:     
189 219
    <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>
220
      <xsl:when test="./gco:Boolean = 0"><span>Exclusion</span></xsl:when>
221
      <xsl:when test="./gco:Boolean = 1"><span>Inclusion</span></xsl:when>
192 222
    </xsl:choose>
193 223
    </span>
194 224
  </xsl:template>
lib/style/skins/metacatui/iso/isoroot.xsl
12 12
    <xsl:import href="iso-ex.xsl"/>
13 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" />  
19

  
15 20
    <!-- TODO: Figure out how to set the output method to get what I want -->
16 21
    <!-- TODO: ^ Figure out what I want to output -->
17 22
    <!-- TODO: Figuer out what this match statement should have in it -->
18
    <xsl:template match="/">
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>
33
            </div>
19 34

  
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()" />
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>
30 42
                </div>
31 43
            </div>
32
        </div>
33 44

  
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>
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>
38 49

  
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()" />
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>
45 57
                </div>
46 58
            </div>
47
        </div>
48 59

  
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>
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>
59 73
                </div>
60
            </div>
61
        </div>
74
            </xsl:if>
75
            
62 76

  
63
        <!-- Keywords
77
            <!-- Keywords
64 78

  
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
        -->
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
            -->
68 82

  
69
        <xsl:for-each select="//gmd:descriptiveKeywords">
70
            <xsl:call-template name="topiccategory"/>
71
        </xsl:for-each>
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
            
72 97

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

  
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" />
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>
81 107
                </div>
82 108
            </div>
83
        </div>
84 109

  
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" />
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>
91 117
                </div>
92 118
            </div>
93
        </div>
94 119

  
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">
120
            <!-- Cited responsible parties-->
107 121
            <div class="control-group">
108
                <label class="control-label">Extent</label>
122
                <label class="control-label">Associated Parties</label>
109 123
                <div class="controls">
110 124
                    <div class="controls-well">
111
                        <xsl:call-template name="extent" />
125
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
112 126
                    </div>
113 127
                </div>
114 128
            </div>
115
        </xsl:for-each>
116 129

  
117
        <!-- TODO Methods -->
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>
118 141

  
142
            <!-- TODO Methods -->
143

  
119 144
        </form>
120 145
    </xsl:template>
121 146

  
......
135 160
    </xsl:template>
136 161

  
137 162
    
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>
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>
149 167

  
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>
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>
161 173
    </xsl:template>
162 174

  
163 175
    <!-- Contact -->

Also available in: Unified diff