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

RE: Another (positional?) grouping problem

Subject: RE: Another (positional?) grouping problem
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 19 Oct 2006 15:07:10 +0100
RE:  Another (positional?) grouping problem
Try

<xsl:for-each-group select="* except BALANCE_OLD"
group-starting-with="DATE">


Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Rudolf P. Weinmann [mailto:rudolf.weinmann@xxxxxxxxxxxx] 
> Sent: 19 October 2006 14:54
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Another (positional?) grouping problem
> 
> Hi
> 
> Could anybody please tell me how to solve the following 
> grouping problem with xslt 2.0?
> 
> The input isn't structured. There is a root element and a 
> sequence of elements.
> Input:
> <DOC>
>   <BALANCE_OLD>3141.70</BALANCE_OLD>
>   <DATE>2006-04-26</DATE>
>   <VALUE_DATE>2006-04-25</VALUE_DATE>
>   <TEXT>text 1</TEXT>
>   <TEXT>text 2</TEXT>
>   <TEXT>text 3</TEXT>
>   <TEXT>text 4</TEXT>
>   <AMOUNT>315.00</AMOUNT>
>   <BALANCE_NEW>3456.70</BALANCE_NEW>
>   <DATE>2006-04-28</DATE>
>   <VALUE_DATE>2006-04-26</VALUE_DATE>
>   <TEXT>Text 1</TEXT>
>   <TEXT>Text 2</TEXT>
>   <AMOUNT>465.00</AMOUNT>
>   <BALANCE_NEW>3921.70</BALANCE_NEW>
> </DOC>
> 
> Each DATE element is the start of a group. The end of the 
> group is either the next DATE element or the end of the input.
> I need to put the elements of each group into a <Transaction> 
> element as follows:
> 
> <Trx>
>   <Transaction>
>     <Date>2006-04-26</Date>
>     <ValueDate>2006-04-25</ValueDate>
>     <Text>text 1</Text>
>     <Text>text 2</Text>
>     <Text>text 3</Text>
>     <Text>text 4</Text>
>     <Amount>315.00</Amount>
>     <NewBalance>3456.70</NewBalance>
>   </Transaction>
>   <Transaction>
>     <Date>2006-04-28</Date>
>     <ValueDate>2006-04-26</ValueDate>
>     <Text>Text 1</Text>
>     <Text>Text 2</Text>
>     <Amount>465.00</Amount>
>     <NewBalance>3921.70</NewBalance>
>   </Transaction>
> </Trx>
> 
> How can this be done with xslt 2.0?
> 
> Any help greatly appreciated,
> Rudolf

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.