You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by th...@sgcib.com on 2005/12/07 22:52:33 UTC

group-by

This may be slightly off topic but maybe someone could help me out.


I am confused about the group-by XSL functionality


            <xsl:for-each-group
select="xmlReportOutput/reportOutput/records/record"
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>



However  the values in $sortColumn1   has 4 different possibilities ....
lets say "A", "B", "C", "D"

and I need some logic that groups all "A"s into one group and everything
else into another group ( A = group1 -- B,C,D = group2 ) .

Is there an easy way to do that?

*************************************************************************
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. 

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

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: group-by

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Dec 7, 2005, at 22:52, thomas.maciejewski@sgcib.com wrote:

Hi,

I saw this question was still unanswered. This is most likely because  
it is indeed slightly OT for this list. For XSLT-related questions,  
you may want to check out the Mulberry XSLT list in the future.

> I am confused about the group-by XSL functionality
>
>
>             <xsl:for-each-group
> select="xmlReportOutput/reportOutput/records/record"
> 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>
>
>
>
> However  the values in $sortColumn1   has 4 different  
> possibilities ....
> lets say "A", "B", "C", "D"
>
> and I need some logic that groups all "A"s into one group and  
> everything
> else into another group ( A = group1 -- B,C,D = group2 ) .

I haven't had much experience with XSLT 2.0 yet, but I suppose, since  
the group-by attribute must be an expression, you could try something  
like:

group-by="saxon:evaluate($sortColumn1)='A'"


HTH!

Cheers,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org