RE: [xsl] Grouping with keys or xpath

Subject: RE: [xsl] Grouping with keys or xpath
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Fri, 4 Oct 2002 11:28:17 +0100
Hi Uffe

> Hello,
> I have achived to group my xml input(see further down) to the 
> desired output (see further down) 
> with with xsl file (see further down) using xpath, but I have 
> not manage to do the same with keys and the key function. The problem
> is that the key is global for the whole document. I only want 
> to group each articlerow in one variant at time.
> Any hint/help would be appreciated
> Best regards
> Uffe

You can still use the Muenchian method.

If a basic key is 
	<xsl:key name="article_posn" match="nev_article_pos" use="."/>

it can be made more specific by making the "use" part a combination of the
nev_article_pos value and the id of its parent, for example.

<xsl:key name="a_row_article_posn" 

then you can get the unique nev_article_pos's per article_row like so:

<xsl:template match="article_row">
	<xsl:variable name="p_id" select="generate-id(.)"/>
	<xsl:for-each select="nev_article_posn[generate-id(.) = 

it's a bit of a headache to look at but it's much quicker than


 XSL-List info and archive:

Current Thread