Re: [xsl] Tricky inclusion match

Subject: Re: [xsl] Tricky inclusion match
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 29 Mar 2005 13:07:02 -0600
On Tue, 29 Mar 2005 11:34:02 -0700, Karl Stubsjoen <kstubs@xxxxxxxxx> wrote:
> groupa_count and groupb_count are really the collection of results
> from the match on "record".  So the result for group a might be:
> 
> <groupa_count>
>   <value>1</value>
>   <value>2</value>
>   <value>1</value>
> </groupa_count>
> 
> The sum of group a would then be:  4
> 

Ummm...ok.  I'm a little confused because the xslt doesn't seem to
match the input you gave earlier in this thread.  Also because there
was some mention of you working with result tree fragments and not
nodesets.  That might have been a misunderstanding.

But it appears that 

<xsl:template match="record" mode="COUNT">
> <xsl:value-of select="number(count(ancestor::recordset/record[field[@fieldname='paint']
> = current()/field[@fieldname='paint']]))"/>
> </xsl:template>

Returns a number, not a nodeset.  Of course, I'm pretty new to xslt.

Of the top of my head I would imagine something like 

<xsl:value-of select="sum($groupa_count/data/value)"/>

should work if it is a node set like the one you described.

Current Thread