Re: [xsl] XSLT2 grouping over multiple documents

Subject: Re: [xsl] XSLT2 grouping over multiple documents
From: "Thomas J. Sebestyen" <a9105535@xxxxxxxxxxxxxxxxx>
Date: Thu, 23 Jun 2005 10:35:41 +0200
Hello Michael,

Michael Kay schrieb:
> You don't actually need to make copies of all the documents before grouping
> them. Just do
> <xsl:for-each-group select="document(a/@href)/responses/response"
>     group-by="@for">

Something like this was my first try, but did not work (therefor the
copy). Seems I have made a mistake.

> The inner loop:
> <xsl:for-each-group select="current-group()"
> > group-by="@correct">
> >               <xsl:value-of select="count(current-group())" />
> >             </xsl:for-each-group>
> is interesting because a selected element doesn't get put in a group if the
> grouping key evaluates to an empty sequence. So it seems there will only be
> one group coming out of this, the group that has @correct='correct'.

Yes, in this case is this wanted, but ...

> So this
> loop seems unnecessary, it is equivalent to
> <xsl:value-of select="count(current-group()[@correct='correct'])"/>

this is, I was looking for.

Thank You!


Current Thread