Project

General

Profile

« Previous | Next » 

Revision 5721

include template for rendering a single attribute

View differences:

lib/style/skins/semtools/annotation.xsl
39 39
	<xsl:param name="qformat">semtools</xsl:param>
40 40
	<xsl:param name="enableediting">false</xsl:param>
41 41
	<xsl:param name="contextURL"/>
42
	<xsl:param name="attributeLabel"/>
43
	
42 44
	<xsl:template match="/">
45
	
43 46
		<html>
44 47
			<head>
45 48
				<title>Annotation Details</title>
46
				<link rel="stylesheet" type="text/css"
47
					src="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />
48 49
				<script language="javascript" type="text/javascript" 
49 50
					src="{$contextURL}/style/common/jquery/jquery.js"></script>	
50 51
				<script language="Javascript" type="text/JavaScript"
......
52 53
				<script language="Javascript" type="text/JavaScript"
53 54
					src="{$contextURL}/style/common/branding.js" />
54 55
				<script language="Javascript" type="text/JavaScript"
55
					src="{$contextURL}/style/skins/semtools/search.js" />	
56
					src="{$contextURL}/style/skins/semtools/search.js" />
57
				<link rel="stylesheet" type="text/css"
58
					src="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />		
56 59
			</head>
57 60

  
58 61
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
59
				<script language="JavaScript">
60
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
61
				</script>
62
				
63 62
				<div id="content_wrapper">
64
				
65
				<div class="group group_border">
66
					<h3>Semantic Annotation</h3>
63
												
64
					<!-- single attribute detail -->
65
					<xsl:choose>
66
						<xsl:when test="$attributeLabel != ''">
67
							
68
							<xsl:call-template name="attributeDetail">
69
								<xsl:with-param name="attributeLabel" select="$attributeLabel" />
70
							</xsl:call-template>
71
															
72
						</xsl:when>
73
						<xsl:otherwise>
74
						
75
							<script language="JavaScript">
76
								insertTemplateOpening('<xsl:value-of select="$contextURL" />');
77
							</script>
78
							
79
													
80
							<!-- annotation details -->
81
							<div class="group group_border">
82
								<h3>Semantic Annotation</h3>
83
							</div>
84
		
85
							<xsl:for-each select="/*[local-name()='annotation']">
86
								<xsl:call-template name="annotation"/>
87
							</xsl:for-each>
88
							
89
							
90
							<script language="JavaScript">
91
								insertTemplateClosing('<xsl:value-of select="$contextURL" />');
92
							</script>
93
							
94
						</xsl:otherwise>
95
					</xsl:choose>
67 96
				</div>
68
				<xsl:for-each select="/*[local-name()='annotation']">
69
					<xsl:call-template name="annotation"/>
70
				</xsl:for-each>	
71
				
72
				</div>
73
				
74
				<script language="JavaScript">
75
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
76
				</script>
77 97
			</body>
78 98
			
79 99
		</html>
100
		
80 101
	</xsl:template>
81 102
	
82 103
</xsl:stylesheet>
lib/style/skins/semtools/annotation-root.xsl
43 43
	<xsl:param name="tripleURI"><xsl:value-of select="$contextURL" /><![CDATA[/metacat?action=read&qformat=]]><xsl:value-of select="$qformat" /><![CDATA[&sessionid=]]><xsl:value-of select="$sessionid" /><![CDATA[&docid=]]></xsl:param>
44 44
	
45 45
	<xsl:key name="mapping" match="//*[local-name()='map']" use="@measurement" />
46
	<xsl:key name="attributes" match="//*[local-name()='map']" use="@attribute" />
47
	<xsl:key name="measurements" match="//*[local-name()='measurement']" use="@label" />
46 48
	
47 49
	<xsl:template name="annotation">
48 50
		<xsl:param name="showAll">true</xsl:param>
49

  
50 51
		<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="subGroup">
51 52
			<tr>
52 53
				<td>
......
125 126
			<xsl:if test="$showAll='true'">
126 127
				<xsl:for-each select="./*[local-name()='observation']">
127 128
					<tr>
128
						<td class="text_plain" colspan="2">
129
						<td class="text_plain">
129 130
							<table class="subGroup subGroup_border">
130 131
								<tr>
131 132
									<th>
132
										<xsl:attribute name="colspan">
133
											<xsl:value-of select="count(./*[local-name()='measurement'])"/>
134
										</xsl:attribute>
135 133
										Observation
136 134
									</th>
137 135
								</tr>
138 136
								<tr valign="top">
139
								
140 137
									<!-- observation entity -->
141 138
									<td>
142
										<xsl:attribute name="colspan">
143
											<xsl:value-of select="count(./*[local-name()='measurement'])"/>
144
										</xsl:attribute>
145 139
										<table>
146 140
											<tr>
147 141
												<td class="rowodd">
......
179 173
										</table>		
180 174
									</td>
181 175
								</tr>
182
								<tr>	
183
									<!-- measurement -->
184
									<xsl:for-each select="./*[local-name()='measurement']">
185
										<td class="text_plain">
186
											<table class="subGroup subGroup_border">
187
												<tr>
188
													<th colspan="3"> 	
189
														Measurement (<xsl:value-of select="./@label" />)
190
													</th>
191
												</tr>	
192
												<tr>
193
													<td class="rowodd">					
194
														Column:
195
													</td>
196
													<td class="roweven">					
197
														<xsl:for-each select="key('mapping', @label)">
198
															<xsl:value-of select="./@attribute" />
199
														</xsl:for-each>
200
													</td>
201
													<td class="roweven"></td>
202
												</tr>
203
												<tr>
204
													<td class="rowodd">					
205
														Characteristic[s]:
206
													</td>
207
													<td class="roweven">
208
														<xsl:for-each select="./*[local-name()='characteristic']">
209
															<p>
210
																<xsl:attribute name="title">
211
																	<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
212
																	<xsl:text>#</xsl:text>
213
																	<xsl:value-of select="substring-after(./@id, ':')"/>
214
																</xsl:attribute>
215
																<xsl:value-of select="substring-after(./@id, ':')"/>
216
															</p>	
217
														</xsl:for-each>
218
													</td>
219
													<!-- 
220
													<td class="roweven">					
221
														<xsl:for-each select="./*[local-name()='characteristic']">
222
															<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
223
														</xsl:for-each>
224
													</td>
225
													-->
226
												</tr>
227
												<tr>
228
													<td class="rowodd">					
229
														Standard:
230
													</td>
231
													<td class="roweven">
232
														<p>
233
															<xsl:attribute name="title">
234
																<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
235
																<xsl:text>#</xsl:text>
236
																<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>	
237
															</xsl:attribute>					
238
															<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>
239
														</p>							
240
													</td>
241
													<!-- 
242
													<td class="roweven">					
243
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
244
													</td>
245
													-->
246
												</tr>
247
												<tr>
248
													<td class="rowodd">					
249
														Protocol:
250
													</td>
251
													<td class="roweven">
252
														<p>
253
															<xsl:attribute name="title">
254
																<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
255
																<xsl:text>#</xsl:text>
256
																<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
257
															</xsl:attribute>					
258
															<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
259
														</p>
260
													</td>
261
													<!-- 
262
													<td class="roweven">					
263
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
264
													</td>
265
													-->
266
												</tr>
267
											</table>
268
										</td>	
269
									</xsl:for-each> <!-- measurement -->
176
								<tr>
177
									<td>
178
										<table>
179
											<tr>
180
												<!-- measurement -->
181
												<xsl:for-each select="./*[local-name()='measurement']">
182
													<xsl:call-template name="measurement" />
183
												</xsl:for-each> 
184
												<!-- measurement -->
185
											</tr>
186
										</table>			
187
									</td>	
270 188
								</tr>
271 189
							</table>
272 190
						</td>		
......
275 193
			</xsl:if>
276 194
			
277 195
			<tr class="searchresultsdivider">
278
				<td colspan="5">
279
				</td>
196
				<td></td>
280 197
			</tr>
281
			
282
		</table>
198
		</table>		
283 199
		
284 200
	</xsl:template>
201
	
202
	<xsl:template name="measurement">
203
		<!-- measurement -->
204
		<td class="text_plain">
205
			<table class="subGroup subGroup_border">
206
				<tr>
207
					<th colspan="3"> 	
208
						Measurement (<xsl:value-of select="./@label" />)
209
					</th>
210
				</tr>	
211
				<tr>
212
					<td class="rowodd">					
213
						Column:
214
					</td>
215
					<td class="roweven">					
216
						<xsl:for-each select="key('mapping', @label)">
217
							<xsl:value-of select="./@attribute" />
218
						</xsl:for-each>
219
					</td>
220
					<td class="roweven"></td>
221
				</tr>
222
				<tr>
223
					<td class="rowodd">					
224
						Characteristic[s]:
225
					</td>
226
					<td class="roweven">
227
						<xsl:for-each select="./*[local-name()='characteristic']">
228
							<p>
229
								<xsl:attribute name="title">
230
									<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
231
									<xsl:text>#</xsl:text>
232
									<xsl:value-of select="substring-after(./@id, ':')"/>
233
								</xsl:attribute>
234
								<xsl:value-of select="substring-after(./@id, ':')"/>
235
							</p>	
236
						</xsl:for-each>
237
					</td>
238
				</tr>
239
				<tr>
240
					<td class="rowodd">					
241
						Standard:
242
					</td>
243
					<td class="roweven">
244
						<p>
245
							<xsl:attribute name="title">
246
								<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
247
								<xsl:text>#</xsl:text>
248
								<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>	
249
							</xsl:attribute>					
250
							<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>
251
						</p>							
252
					</td>
253
				</tr>
254
				<tr>
255
					<td class="rowodd">					
256
						Protocol:
257
					</td>
258
					<td class="roweven">
259
						<p>
260
							<xsl:attribute name="title">
261
								<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
262
								<xsl:text>#</xsl:text>
263
								<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
264
							</xsl:attribute>					
265
							<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
266
						</p>
267
					</td>
268
				</tr>
269
			</table>
270
		</td>	
271
		
272
	</xsl:template>
273
	
274
	<xsl:template name="attributeDetail">
275
		<xsl:param name="attributeLabel"/>
276
		<!-- look up the attribute mapping for the given label -->
277
		<xsl:for-each select="key('attributes', $attributeLabel)">
278
			<!-- get the <measurement> node using this label -->
279
			<table class="subGroup subGroup_border">
280
				<tr>
281
					<xsl:for-each select="key('measurements', ./@measurement)">
282
						<xsl:call-template name="measurement"/>
283
					</xsl:for-each>
284
				</tr>
285
			</table>		
286
		</xsl:for-each>
287
	</xsl:template>
285 288

  
286 289
</xsl:stylesheet>

Also available in: Unified diff