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

Re: Group elements based on summing values (XSL 1.0)

Subject: Re: Group elements based on summing values (XSL 1.0)
From: "Ihe Onwuka ihe.onwuka@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Feb 2015 11:24:20 -0000
Re:  Group elements based on summing values (XSL 1.0)
Well if you need to group things in XSLT 1.0 the stock answer here tends to
be Muenchian grouping.

 Some people have internalized the algorithm but I am not one of them as I
rarely ever used it so in that sense i'm as rusty as you are. But thats
your pointer.

On Fri, Feb 6, 2015 at 10:44 AM, Kevin Bird kevinbrianbird@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Hello,
>
> My XSL skills are a bit rusty.
>
> Starting from the first <num> element, I need to create the smallest group
> possible where the sum of the <num> elements totals 10 or more. I am only
> able to use XSL 1.0.
>
> INPUT:
> <row>
>     <num>3</num>
>     <num>4</num>
>     <num>4</num>
>     <num>7</num>
>     <num>12</num>
>     <num>15</num>
>     <num>1</num>
> </row>
>
> OUTPUT:
> <row>
>     <group1>
>         <num>3</num>
>         <num>4</num>
>         <num>4</num>
>     </group1>
>     <group2>
>         <num>7</num>
>         <num>12</num>
>         <num>15</num>
>         <num>1</num>
>     </group2>
> </row>
>
> Any help/pointers appreciated.
>
> --
> Kevin

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.