Project

General

Profile

Revision 9797

consolidate online access section. format xsl whitespace

View differences:

lib/style/common/dcx/onedcx-common.xsl
1 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" 
3
  xmlns:dct="http://purl.org/dc/terms/" 
4
  xmlns:dcx="http://ns.dataone.org/metadata/schema/onedcx/v1.0" 
5
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
7
  xmlns="http://purl.org/dc/terms/">
2
<xsl:stylesheet version="1.0" xmlns:dct="http://purl.org/dc/terms/"
3
	xmlns:dcx="http://ns.dataone.org/metadata/schema/onedcx/v1.0"
4
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
	xmlns="http://purl.org/dc/terms/">
8 6

  
9 7

  
10
  <xsl:template name="onedcx">
11
    <article class="container" id="Metadata">
12
    	<xsl:for-each select="*">
13
    	
14
	      <xsl:call-template name="citation"/>
15
	      <xsl:call-template name="downloads"/>
16
	      <xsl:call-template name="general"/>
17
	      <xsl:call-template name="keywords" />
18
	      <xsl:call-template name="people" />
19
	      <xsl:call-template name="geography" />
20
	      <xsl:call-template name="temporal" />
21
	      
22
    	</xsl:for-each>
23
      
24
    </article>
25
  </xsl:template>
8
	<xsl:template name="onedcx">
9
		<article class="container" id="Metadata">
10
			<xsl:for-each select="*">
26 11

  
27
  <xsl:template name="citation">
28
    <cite class="citation">
29
      <xsl:value-of select="normalize-space(dcx:dcTerms/dct:bibliographicCitation)"/>
30
    </cite>
31
  </xsl:template>
12
				<xsl:call-template name="citation" />
13
				<xsl:call-template name="general" />
14
				<xsl:call-template name="keywords" />
15
				<xsl:call-template name="people" />
16
				<xsl:call-template name="geography" />
17
				<xsl:call-template name="temporal" />
32 18

  
33
  <xsl:template name="downloads">
34
    <div id="downloadContents">
35
    <h4>Online Access</h4>
36
      <xsl:for-each select="dcx:dcTerms/dct:references">
37
        <a>
38
          <xsl:attribute name="href">
39
            <xsl:value-of select="."/>
40
          </xsl:attribute>
41
          <xsl:value-of select="."/>
42
        </a>
43
      </xsl:for-each>
44
    </div>
45
  </xsl:template>
19
			</xsl:for-each>
46 20

  
47
  <xsl:template name="general">
48
    <h4>General Content</h4>
49
    <div class="control-group">
50
      <label class="control-label">Title</label>
51
      <div class="controls controls-well">
52
        <strong>
53
          <xsl:value-of select="normalize-space(dcx:simpleDc/dct:title)"/>
54
        </strong>
55
      </div>
56
    </div>
57
    <div class="control-group">
58
      <label class="control-label">Identifier</label>
59
      <div class="controls">
60
        <div class="controls-well">
61
          <xsl:value-of select="$pid"/>
62
        </div>
63
      </div>
64
    </div>
65
    <div class="control-group">
66
      <label class="control-label">Alternate Identifier</label>
67
      <div class="controls">
68
        <div class="controls-well">
69
          <xsl:value-of select="normalize-space(dcx:simpleDc/dct:identifier)"/>
70
        </div>
71
      </div>
72
    </div>
73
    <div class="control-group">
74
      <label class="control-label">Abstract</label>
75
      <div class="controls controls-well">
76
        <div class="sectionText">
77
          <p>
78
            <xsl:value-of select="normalize-space(dcx:dcTerms/dct:abstract)"/>
79
          </p>
80
        </div>
81
      </div>
82
    </div>
83
  </xsl:template>
21
		</article>
22
	</xsl:template>
84 23

  
85
  <xsl:template name="keywords">
86
    <div class="row-fluid">
87
      <div class="control-group">
88
        <label class="control-label">Keywords</label>
89
        <div class="controls controls-well">
90
          <p>Dublin Core Terms subject</p>
91
        </div>
92
        <table class="table table-striped table-condensed">
93
          <thead>
94
            <tr><th>Keyword</th><th>Type</th></tr>
95
          </thead>
96
          <xsl:apply-templates select="dcx:simpleDc/dct:subject" />
97
        </table>
98
      </div>
99
    </div>
100
  </xsl:template>
24
	<xsl:template name="citation">
25
		<cite class="citation">
26
			<xsl:value-of
27
				select="normalize-space(dcx:dcTerms/dct:bibliographicCitation)" />
28
		</cite>
29
	</xsl:template>
101 30

  
102
  <xsl:template name="keyword" match="dct:subject">
103
    <tr>
104
      <td><xsl:value-of select="." /></td>
105
      <td></td>
106
    </tr>
107
  </xsl:template>
31
	<xsl:template name="general">
32
		<h4>General Content</h4>
33
		<div class="control-group">
34
			<label class="control-label">Title</label>
35
			<div class="controls controls-well">
36
				<strong>
37
					<xsl:value-of select="normalize-space(dcx:simpleDc/dct:title)" />
38
				</strong>
39
			</div>
40
		</div>
41
		<div class="control-group">
42
			<label class="control-label">Identifier</label>
43
			<div class="controls">
44
				<div class="controls-well">
45
					<xsl:value-of select="$pid" />
46
				</div>
47
			</div>
48
		</div>
49
		<div class="control-group">
50
			<label class="control-label">Alternate Identifier</label>
51
			<div class="controls">
52
				<div class="controls-well">
53
					<xsl:value-of select="normalize-space(dcx:simpleDc/dct:identifier)" />
54
				</div>
55
			</div>
56
		</div>
57
		
58
		<div class="control-group">
59
			<label class="control-label">Online Access</label>
60
			<div class="controls controls-well">
61
				<xsl:for-each select="dcx:dcTerms/dct:references">
62
					<a>
63
						<xsl:attribute name="href">
64
							<xsl:value-of select="." />
65
						</xsl:attribute>
66
						<xsl:value-of select="." />
67
					</a>
68
				</xsl:for-each>
69
			</div>
70
		</div>
71
		
72
		
73
		<div class="control-group">
74
			<label class="control-label">Abstract</label>
75
			<div class="controls controls-well">
76
				<div class="sectionText">
77
					<p>
78
						<xsl:value-of select="normalize-space(dcx:dcTerms/dct:abstract)" />
79
					</p>
80
				</div>
81
			</div>
82
		</div>
83
	</xsl:template>
108 84

  
109
  <xsl:template name="people">
110
	<h4>Creators</h4>
111
	  <xsl:for-each select="dcx:simpleDc/dct:creator">
112
	  <div class="controls controls-well">
113
	  	<xsl:value-of select="." />
114
	  </div>
115
	  </xsl:for-each>
116
  
117
  </xsl:template>
85
	<xsl:template name="keywords">
86
		<div class="row-fluid">
87
			<div class="control-group">
88
				<label class="control-label">Keywords (Dublin Core Terms subject)</label>
89
				<div class="controls controls-well">
90
					<table class="table table-striped table-condensed">
91
						<thead>
92
							<tr>
93
								<th>Keyword</th>
94
								<th>Type</th>
95
							</tr>
96
						</thead>
97
						<xsl:apply-templates select="dcx:simpleDc/dct:subject" />
98
					</table>
99
				</div>
118 100

  
119
  <xsl:template name="geography">
120
    <div class="row-fluid">
121
      <div data-content="geographicCoverage" class="row-fluid geographicCoverage">
122
        <h4>Geographic Region</h4>
123
        <div data-content="geographicDescription" class="control-group geographicDescription">
124
          <label class="control-label">Geographic Description</label>
125
          <div class="controls controls-well">
126
            <xsl:value-of select="//dcx:dcTerms/dct:spatial[not(@xsi:type='dcterms:Box')]" />
127
          </div>
128
        </div>
129
        
130
        <div data-content="boundingCoordinates" class="control-group boundingCoordinates">
131
          <label class="control-label">Bounding Coordinates</label>
132
          <xsl:for-each select="//dcx:dcTerms/dct:spatial[@xsi:type='Box']">
133
          	<xsl:call-template name="extract-coordinates"/>
134
          </xsl:for-each>
135
        </div>
136
        
137
      </div>
138
    </div>
139
  </xsl:template>
101
			</div>
102
		</div>
103
	</xsl:template>
140 104

  
141
  <xsl:template name="extract-coordinates">
142
    <xsl:call-template name="show-coordinate">
143
      <xsl:with-param name="data" select="." />
144
      <xsl:with-param name="corner" select="'northlimit'" />
145
      <xsl:with-param name="label" select="'North'" />
146
      <xsl:with-param name="bound" select="'northBoundingCoordinate'" />
147
    </xsl:call-template>
148
    <xsl:call-template name="show-coordinate">
149
      <xsl:with-param name="data" select="." />
150
      <xsl:with-param name="corner" select="'southlimit'" />
151
      <xsl:with-param name="label" select="'South'" />
152
      <xsl:with-param name="bound" select="'southBoundingCoordinate'" />
153
    </xsl:call-template>
154
    <xsl:call-template name="show-coordinate">
155
      <xsl:with-param name="data" select="." />
156
      <xsl:with-param name="corner" select="'eastlimit'" />
157
      <xsl:with-param name="label" select="'East'" />
158
      <xsl:with-param name="bound" select="'eastBoundingCoordinate'" />
159
    </xsl:call-template>
160
    <xsl:call-template name="show-coordinate">
161
      <xsl:with-param name="data" select="." />
162
      <xsl:with-param name="corner" select="'westlimit'" />
163
      <xsl:with-param name="label" select="'West'" />
164
      <xsl:with-param name="bound" select="'westBoundingCoordinate'" />
165
    </xsl:call-template>
166
  </xsl:template>
105
	<xsl:template name="keyword" match="dct:subject">
106
		<tr>
107
			<td>
108
				<xsl:value-of select="." />
109
			</td>
110
			<td></td>
111
		</tr>
112
	</xsl:template>
167 113

  
168
  <xsl:template name="show-coordinate">
169
    <xsl:param name="data" />
170
    <xsl:param name="corner" />
171
    <xsl:param name="label" />
172
    <xsl:param name="bound" />
173
    <xsl:variable name="coord" select="substring-before(substring-after($data,concat($corner,'=')),';')" />
174
    <div data-value="{$coord}" 
175
         data-content="{$bound}" 
176
         class="control-group {$bound}">
177
      <label class="control-label"><xsl:value-of select="$label" /></label>
178
      <div class="controls controls-well"><xsl:value-of select="$coord"/><xsl:text> degrees</xsl:text></div>
179
    </div>
180
  </xsl:template>
114
	<xsl:template name="people">
115
		<h4>Creators</h4>
116
		<xsl:for-each select="dcx:simpleDc/dct:creator">
117
			<div class="controls controls-well">
118
				<xsl:value-of select="." />
119
			</div>
120
		</xsl:for-each>
181 121

  
182
  <xsl:template name="temporal">
183
    <div class="row-fluid">
184
      <div data-content="temporalCoverage" class="row-fluid temporalCoverage">
185
        <h4>Temporal Coverage</h4>
186
        <div class="control-group">
187
        <label class="control-label">Date Range</label>
188
        <div class="controls controls-well">
189
          <div class="control-group">
190
            <label class="control-label">Begin</label>
191
            <div class="controls">
192
              <div class="row-fluid">
193
                <xsl:value-of select="dcx:dcTerms/dct:temporal" />
194
              </div>
195
            </div>
196
          </div>
197
          <div class="control-group">
198
            <label class="control-label">End</label>
199
            <div class="controls">
200
              <div class="row-fluid">
201
                <xsl:value-of select="dcx:dcTerms/dct:temporal" />
202
              </div>
203
            </div>
204
          </div>
205
        </div>
206
      </div>
207
      </div>
208
    </div>
209
  </xsl:template>
122
	</xsl:template>
210 123

  
124
	<xsl:template name="geography">
125
		<div class="row-fluid">
126
			<div data-content="geographicCoverage" class="row-fluid geographicCoverage">
127
				<h4>Geographic Region</h4>
128
				<div data-content="geographicDescription" class="control-group geographicDescription">
129
					<label class="control-label">Geographic Description</label>
130
					<div class="controls controls-well">
131
						<xsl:value-of
132
							select="//dcx:dcTerms/dct:spatial[not(@xsi:type='dcterms:Box')]" />
133
					</div>
134
				</div>
135

  
136
				<div data-content="boundingCoordinates" class="control-group boundingCoordinates">
137
					<label class="control-label">Bounding Coordinates</label>
138
					<xsl:for-each select="//dcx:dcTerms/dct:spatial[@xsi:type='Box']">
139
						<xsl:call-template name="extract-coordinates" />
140
					</xsl:for-each>
141
				</div>
142

  
143
			</div>
144
		</div>
145
	</xsl:template>
146

  
147
	<xsl:template name="extract-coordinates">
148
		<xsl:call-template name="show-coordinate">
149
			<xsl:with-param name="data" select="." />
150
			<xsl:with-param name="corner" select="'northlimit'" />
151
			<xsl:with-param name="label" select="'North'" />
152
			<xsl:with-param name="bound" select="'northBoundingCoordinate'" />
153
		</xsl:call-template>
154
		<xsl:call-template name="show-coordinate">
155
			<xsl:with-param name="data" select="." />
156
			<xsl:with-param name="corner" select="'southlimit'" />
157
			<xsl:with-param name="label" select="'South'" />
158
			<xsl:with-param name="bound" select="'southBoundingCoordinate'" />
159
		</xsl:call-template>
160
		<xsl:call-template name="show-coordinate">
161
			<xsl:with-param name="data" select="." />
162
			<xsl:with-param name="corner" select="'eastlimit'" />
163
			<xsl:with-param name="label" select="'East'" />
164
			<xsl:with-param name="bound" select="'eastBoundingCoordinate'" />
165
		</xsl:call-template>
166
		<xsl:call-template name="show-coordinate">
167
			<xsl:with-param name="data" select="." />
168
			<xsl:with-param name="corner" select="'westlimit'" />
169
			<xsl:with-param name="label" select="'West'" />
170
			<xsl:with-param name="bound" select="'westBoundingCoordinate'" />
171
		</xsl:call-template>
172
	</xsl:template>
173

  
174
	<xsl:template name="show-coordinate">
175
		<xsl:param name="data" />
176
		<xsl:param name="corner" />
177
		<xsl:param name="label" />
178
		<xsl:param name="bound" />
179
		<xsl:variable name="coord"
180
			select="substring-before(substring-after($data,concat($corner,'=')),';')" />
181
		<div data-value="{$coord}" data-content="{$bound}" class="control-group {$bound}">
182
			<label class="control-label">
183
				<xsl:value-of select="$label" />
184
			</label>
185
			<div class="controls controls-well">
186
				<xsl:value-of select="$coord" />
187
				<xsl:text> degrees</xsl:text>
188
			</div>
189
		</div>
190
	</xsl:template>
191

  
192
	<xsl:template name="temporal">
193
		<div class="row-fluid">
194
			<div data-content="temporalCoverage" class="row-fluid temporalCoverage">
195
				<h4>Temporal Coverage</h4>
196
				<div class="control-group">
197
					<label class="control-label">Date Range</label>
198
					<div class="controls controls-well">
199
						<div class="control-group">
200
							<label class="control-label">Begin</label>
201
							<div class="controls">
202
								<div class="row-fluid">
203
									<xsl:value-of select="dcx:dcTerms/dct:temporal" />
204
								</div>
205
							</div>
206
						</div>
207
						<div class="control-group">
208
							<label class="control-label">End</label>
209
							<div class="controls">
210
								<div class="row-fluid">
211
									<xsl:value-of select="dcx:dcTerms/dct:temporal" />
212
								</div>
213
							</div>
214
						</div>
215
					</div>
216
				</div>
217
			</div>
218
		</div>
219
	</xsl:template>
220

  
211 221
</xsl:stylesheet>

Also available in: Unified diff