[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Problem with a key


Subject: [xsl] Problem with a key
From: russurquhart1@xxxxxxxxxxx
Date: Thu, 22 Mar 2012 16:10:46 -0500 (CDT)

Hi,

I am trying to use a key to return the errata_section title elements, given the device_name element attached to the parent errata_section.

The structure is like the following:

<errata_section>
  <title>Bug title 1</title>

  <devices_impacted>
     <device_name>Mod1</device_name>
  </devices_impacted>
  <devices_impacted>
     <device_name>Mod45</device_name>
  </devices_impacted>
,
,
,
</errata_section>

<errata_section>
.
.
.
</errata_section> 

As several devices maybe addressed in a given errata_section element, i was trying to write a key to pull out, for a given device, ALL the errata_section titles that impact this device name. (Ideally for inclusion into a table based on the device name.

I wrote the following thinking this might work:

	<xsl:key name="bugtitlekey" match="errata_section/title" use="errata_section/devices_impacted/device_name" />
	<xsl:template match="/">
		<xsl:value-of select="key('bugtitlekey', 'Mod4')/text()"/>
	
	</xsl:template>

I don't get any output when i try this. I thought my key def was ok. Do i need to go deeper per each errata_section element?

Any help is greatly appreciated!


Thanks,

Russ 


Current Thread