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

Re: Grouping: Number of groups

Subject: Re: Grouping: Number of groups
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 14 Sep 2012 15:13:26 +0100
Re:  Grouping: Number of groups
I would suggest putting the result of the grouping in a variable, and then processing the variable:

<xsl:variable name="temp">
<xsl:for-each-group ....>
   <group>
   ...
   </group>
</xsl:for-each-group>
</xsl:variable>

then count($temp/group)

Michael Kay
Saxonica

On 14/09/2012 14:08, Norbert Heidbrink wrote:
Hi everybody,

is there a way to retrieve the number of groups that have been found by
<xsl:for-each-group> outside this instruction?


XML: <line> v <tab /> w <tab /> x <tab /> y <tab/> z <line>

(v, w, x, y, z being mixed data)


<xsl:for-each-group select="node()" group-ending-with="tab"> b& here, the function last() gives me the number I want, but b& </xsl:for-each-group> b& I need the figure here. b&


Maybe I am entirely on a false track?


What I want is:
(1) if there are less than n groups do something afterwards.
(2) If there are more than m groups do something different.


Thanks for your answers, Norbert

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.