xsl-list
[Top] [All Lists]

for-each-group

2005-12-12 10:26:59
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. 

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>