[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT2 grouping over multiple documents

Subject: Re: XSLT2 grouping over multiple documents
From: "Thomas J. Sebestyen" <a9105535@xxxxxxxxxxxxxxxxx>
Date: Thu, 23 Jun 2005 10:35:41 +0200
Re:  XSLT2 grouping over multiple documents
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!

Thomas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.