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

[xsl] Muenchian work if more than one value is present


Subject: [xsl] Muenchian work if more than one value is present
From: "russurquhart1@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Mar 2015 16:44:19 -0000

 Hi All,

I have a question about using Muenchian Method in a specific situation.

I have an xml source file like the following:

<errata_section id="i875" errata_type="bug"><title>Title</title><description> <para> Following a warm Reset </para></description><devices_impacted> <device_name>VAZER</device_name></devices_impacted><module_impacted>Boot</module_impacted></errata_section>

The existing xsl, that i am supporting, but didn't write, uses the following key:

<xsl:key name="module-index" match="errata_section" use="module_impacted"/>

And they have used the following Muenchian Method algorithm to go through all the unique module_impacted elements.


<xsl:for-each select="//errata_section[generate-id(.)=generate-id(key('module-index', module_impacted)[1])]"> <xsl:sort select="module_impacted"/>
<!-- Determine module_impacted elements, for given device_name, and output table. -->

</xsl:for-each>

Everything went fine until, over time, we have added additional module_impacted siblings to the errata_section element like this:

<errata_section id="i876" errata_type="bug"><title>Title</title><description> <para> Following a warm Reset </para></description><devices_impacted> <device_name>VAZER</device_name></devices_impacted><module_impacted>Boot</module_impacted><module_impacted>Power-On</module_impacted><module_impacted>DMA</module_impacted></errata_section>

Once this happened we started to see that not all module_impacted elements were being found for the given device_name. My question is, is this happening because the element we are doing the generate-id function on, in some cases would have multiple siblings in a given errata_section element? Most of the examples i have seen of using Muenchian Method are keying on a unique elment value that doesn't have any similar named siblings.

I'm just trying to understand if this structure would work at all. 
Thanks for any info you can provide and thank you Martin Honnen for your help so far!

Russ


Current Thread
Keywords