Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
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/">
6

    
7

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

    
24
		</article>
25
	</xsl:template>
26

    
27
	<xsl:template name="citation">
28
		<cite class="citation">
29
			<xsl:value-of
30
				select="normalize-space(dcx:dcTerms/dct:bibliographicCitation)" />
31
		</cite>
32
	</xsl:template>
33

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

    
88
	<xsl:template name="keywords">
89
		<div class="row-fluid">
90
			<div class="control-group">
91
				<label class="control-label">Keywords (Dublin Core Terms subject)</label>
92
				<div class="controls controls-well">
93
					<table class="table table-striped table-condensed">
94
						<thead>
95
							<tr>
96
								<th>Keyword</th>
97
								<th>Type</th>
98
							</tr>
99
						</thead>
100
						<xsl:apply-templates select="dcx:simpleDc/dct:subject" />
101
					</table>
102
				</div>
103

    
104
			</div>
105
		</div>
106
	</xsl:template>
107

    
108
	<xsl:template name="keyword" match="dct:subject">
109
		<tr>
110
			<td>
111
				<xsl:value-of select="." />
112
			</td>
113
			<td></td>
114
		</tr>
115
	</xsl:template>
116

    
117
	<xsl:template name="people">
118
		<h4>Creators</h4>
119
		<xsl:for-each select="dcx:simpleDc/dct:creator">
120
			<div class="controls controls-well">
121
				<xsl:value-of select="." />
122
			</div>
123
		</xsl:for-each>
124

    
125
	</xsl:template>
126

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

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

    
148
			</div>
149
		</div>
150
	</xsl:template>
151

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

    
179
	<xsl:template name="show-coordinate">
180
		<xsl:param name="data" />
181
		<xsl:param name="corner" />
182
		<xsl:param name="label" />
183
		<xsl:param name="bound" />
184
		<xsl:variable name="coord"
185
			select="substring-before(substring-after($data,concat($corner,'=')),';')" />
186
		<div data-value="{$coord}" data-content="{$bound}" class="control-group {$bound}">
187
			<label class="control-label">
188
				<xsl:value-of select="$label" />
189
			</label>
190
			<div class="controls controls-well">
191
				<xsl:value-of select="$coord" />
192
				<xsl:text> degrees</xsl:text>
193
			</div>
194
		</div>
195
	</xsl:template>
196
	
197
	<xsl:template name="extract-period">
198
		<xsl:call-template name="show-temporal">
199
			<xsl:with-param name="data" select="." />
200
			<xsl:with-param name="field" select="'start'" />
201
			<xsl:with-param name="label" select="'Begin Date'" />
202
		</xsl:call-template>
203
		<xsl:call-template name="show-temporal">
204
			<xsl:with-param name="data" select="." />
205
			<xsl:with-param name="field" select="'end'" />
206
			<xsl:with-param name="label" select="'End Date'" />
207
		</xsl:call-template>
208
	</xsl:template>
209
	
210
	<xsl:template name="show-temporal">
211
		<xsl:param name="data" />
212
		<xsl:param name="field" />
213
		<xsl:param name="label" />
214
		<xsl:variable name="date"
215
			select="substring-before(substring-after($data,concat($field,'=')),';')" />
216
		<label class="control-label">
217
			<xsl:value-of select="$label" />
218
		</label>
219
		<div class="controls controls-well">
220
			<xsl:value-of select="$date" />
221
		</div>
222
	</xsl:template>
223

    
224
	<xsl:template name="temporal">
225
		<div class="row-fluid">
226
			<div data-content="temporalCoverage" class="row-fluid temporalCoverage">
227
				<h4>Temporal Coverage</h4>
228
				<div class="control-group">
229
					<xsl:if test="//dcx:dcTerms/dct:temporal[@xsi:type='Period']/text() != ''">
230
						<label class="control-label">Date Range</label>
231
						<div class="controls controls-well">					
232
							<xsl:for-each select="//dcx:dcTerms/dct:temporal[@xsi:type='Period']">
233
								<xsl:call-template name="extract-period" />
234
							</xsl:for-each>
235
						</div>	
236
					</xsl:if>
237
					<xsl:if test="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]/text() != ''">
238
						<label class="control-label">Single Date</label>
239
						<div class="controls controls-well">					
240
							<xsl:for-each select="//dcx:dcTerms/dct:temporal[not(@xsi:type='Period')]">
241
								<xsl:value-of select="." />
242
							</xsl:for-each>
243
						</div>	
244
					</xsl:if>
245
				</div>
246
			</div>
247
		</div>
248
	</xsl:template>
249

    
250
</xsl:stylesheet>
(2-2/2)