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

Re: group numbering problem

Subject: Re: group numbering problem
From: John Sharp <jsharp@xxxxxx>
Date: Fri, 05 Sep 2003 18:57:55 -0500
xsl number group
I finally get to follow up one of my own posts (!)

The "current-group()" makes this soo easy...


 <xsl:for-each-group select="$subflowData//SubFlow" group-by="@name">

    <xsl:for-each select="current-group()">
      <xsl:variable name="groupIndex">   
        <xsl:number value="position()" />
      </xsl:variable>
      <xsl:variable name="subFlowNode" select="."/>

      <xsl:call-template name="SubFlow">
        <xsl:with-param name="groupIndex" select="$groupIndex"/>
        <xsl:with-param name="subFlowNode" select="$subFlowNode"/>
      </xsl:call-template>

      </xsl:for-each>
    </xsl:for-each-group>

Tx, John.


John Sharp wrote:
> 
> Hi. I'm having a problem generating numbers
> for each of the following (grouped by @name)
> 
> I need output of:
> 
>  Blue   1  Fast TRUE  FALSE
>  Blue   2  Slow TRUE  FALSE
>  Red    1  Fast FALSE FALSE
>  Yellow 1  Fast FALSE FALSE
>  Yellow 2  Fast FALSE FALSE
> 
> From this XML
> 
> <Flow>
>    <SubFlow name="Blue">
>       <Method>Fast</TestMethod>
>       <Include>TRUE</Include>
>       <Execute>FALSE</Execute>
>    </SubFlow>
>    <SubFlow name="Blue">
>       <Method>Slow</TestMethod>
>       <Include>TRUE</Include>
>       <Execute>FALSE</Execute>
>    </SubFlow>
> 
>    <SubFlow name="Red">
>       <Method>Fast</TestMethod>
>       <Include>FALSE</Include>
>       <Execute>FALSE</Execute>
>    </SubFlow>
> 
>    <SubFlow name="Yellow">
>       <Method>Fast</TestMethod>
>       <Include>FALSE</Include>
>       <Execute>FALSE</Execute>
>    </SubFlow>
> 
>    <SubFlow name="Yellow">
>       <Method>Slow</TestMethod>
>       <Include>FALSE</Include>
>       <Execute>FALSE</Execute>
>    </SubFlow>
>  </Flow>
> 
> PS, as I'm on the digest list, a CC copy/reply would be great.
> 
> Kind regards, John

-- 
 Texas Instruments Inc  Product Development    tel:214 480 4253
 PO BOX 660199          MS: 8645 FORE/A-3101   fax:214 480 4401
 12500 TI Boulevard     Dallas, TX 75266-0199       
     nawk nawk,  Who's there ?   Aho, Weinberger and Kerninghan.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.