|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:for-each-group: start groups depending on numb
On 4/27/07, Yves Forkl <Y.Forkl@xxxxxx> wrote:
Relying heavily on xsl:for-each-group in the context of rather complicated transformations, I have run into this situation (and am stuck there...): When specifying, in group-starting-with, the pattern that may start some specific group, I would like to take into account the number of items available for grouping. I'm not too sure what you're asking there, but this transform: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <root> <xsl:for-each-group select="root/*" group-starting-with="A|B|C"> <group> <xsl:copy-of select="current-group()[not(self::A|self::B|self::C)]"/> </group> </xsl:for-each-group> </root> </xsl:template> </xsl:stylesheet> gives this output: <root> <group> <sub>a1</sub> </group> <group> <sub>b1</sub> <sub>b2</sub> <sub>b3</sub> </group> <group> <sub>c1</sub> <sub>c2</sub> </group> </root> Is that what you were after?
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






