Project

General

Profile

« Previous | Next » 

Revision 5727

include annotation id in the xsl:key so that attribute-measurement mappings can be made for each annotation without confusing them across annotations.

View differences:

annotation-root.xsl
42 42
	
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
	<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" />
45
	<xsl:key name="mapping" match="//*[local-name()='map']" use="concat(../@id, @measurement)" />
46
	<xsl:key name="attributes" match="//*[local-name()='map']" use="concat(../@id, @attribute)" />
47
	<xsl:key name="measurements" match="//*[local-name()='measurement']" use="concat(../../@id, @label)" />
48 48
	
49 49
	<xsl:template name="annotation">
50 50
		<xsl:param name="showAll">true</xsl:param>
......
212 212
					<td class="rowodd">					
213 213
						Column:
214 214
					</td>
215
					<td class="roweven">					
216
						<xsl:for-each select="key('mapping', @label)">
215
					<td class="roweven">
216
						<xsl:variable name="columnkey">
217
							<xsl:value-of select="concat(../../@id, @label)" />
218
						</xsl:variable>
219
						<xsl:for-each select="key('mapping', $columnkey )">
217 220
							<xsl:value-of select="./@attribute" />
218 221
						</xsl:for-each>
219 222
					</td>
......
274 277
	<xsl:template name="attributeDetail">
275 278
		<xsl:param name="attributeLabel"/>
276 279
		<!-- look up the attribute mapping for the given label -->
277
		<xsl:for-each select="key('attributes', $attributeLabel)">
280
		<xsl:for-each select="key('attributes', concat(//*[local-name()='annotation']/@id, $attributeLabel))">
278 281
			<!-- get the <measurement> node using this label -->
279 282
			<table>
280 283
				<tr>
281
					<xsl:for-each select="key('measurements', ./@measurement)">
284
					<xsl:for-each select="key('measurements', concat(//*[local-name()='annotation']/@id, ./@measurement))">
282 285
						<xsl:call-template name="measurement"/>
283 286
					</xsl:for-each>
284 287
				</tr>

Also available in: Unified diff