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

for-each-group

Subject: for-each-group
From: thomas.maciejewski@xxxxxxxxx
Date: Mon, 12 Dec 2005 12:26:59 -0500
for each group
I am having a problem with for-each-group and it may be because I just dont
understand it.   (Hopefully I dont get flamed ;-) )

What I want to do is to create a set of groups based on a condition.  like
"foo='Internal'   is that allowed?

what i have been trying is :

            <xsl:for-each-group select="
xmlReportOutput/reportOutput/records/record" group-by="
saxon:evaluate($sortColumn1)!='Internal'">
                  <!--<xsl:for-each-group select="current-group()"
group-by="saxon:evaluate($sortColumn1)">-->
                  <xsl:sort select="saxon:evaluate($sortColumn1)" order="
{$sortColumn1Order}"/>
                  <xsl:variable name="group1" select="
current-grouping-key()"/>
                  <xsl:call-template name="RenderByDesk">
                        <xsl:with-param name="tradeType" select="$group1"/>
                  </xsl:call-template>
            </xsl:for-each-group>

But everything I try either produces no groups or fails and tells me my
group-by.

Originally I was not doing the != Internal and it seemed to work grouping
by the saxon:evaluate($sortColumn1) field.    Ahh do I need to get the
value of that field?

Error in Xpath 2.0 expression Unknown function Name and number of arguments
do not match any function.

Can someone please give me a few pointers on for-each and for-each-group
?   I think I need to use the group one as later on I pass each group on to
a different template:

      <xsl:template name="RenderByDesk">
            <xsl:param name="tradeType"/>
            <xsl:for-each-group select="current-group()" group-by="
saxon:evaluate($sortColumn2)">
                  <xsl:sort select="saxon:evaluate($sortColumn2)" order="
{$sortColumn2Order}"/>
                  <xsl:variable name="group2" select="
current-grouping-key()"/>
                  <xsl:call-template name="RenderByCounterPartyRole">
                        <xsl:with-param name="tradeType" select="$tradeType
"/>
                        <xsl:with-param name="desk" select="$group2"/>
                  </xsl:call-template>
            </xsl:for-each-group>
      </xsl:template>

Tom Maciejewski

*************************************************************************
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited. 
E-mails are susceptible to alteration.   
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates 
shall be liable for the message if altered, changed or falsified. 

*************************************************************************

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.