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

Re: Apply for-each-group to a node subset

Subject: Re: Apply for-each-group to a node subset
From: Raman Gupta <rocketraman@xxxxxxxxxxx>
Date: Fri, 21 Sep 2007 12:53:19 -0400
Re:  Apply for-each-group to a node subset
Tony Graham wrote:
> It may be simpler if you do it all using ">>":
> 
>   <xsl:template match="r">
>     <xsl:copy>
>       <xsl:apply-templates select="*[../g1[1] >> .]"/>
>       <xsl:for-each-group
>         select="g1[1] |
>                 *[(. >> ../g1[1]) and (../g2[last()] >> .)] |
>                 g2[last()]"
>         group-ending-with="g2">
>         <group>
>           <xsl:apply-templates select="current-group()"/>
>         </group>
>       </xsl:for-each-group>
>       <xsl:apply-templates select="*[. >> ../g2[last()]]"/>
>     </xsl:copy>
>   </xsl:template>

Aha! Very nice. Your other email also presented a very easy to
understand solution. Thanks to both Tony and Abel.

Cheers,
Raman

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.