Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [xsl] for-each over sequences of sequences [xsl] for-each over sequences of sequencesTo: Date: 3/1/2009 12:49:00 PM Hello, I run in an issue with for-each over sequences of sequences: <xsl:for-each select="(1,2),3"> <a> <xsl:for-each select="."> <b><xsl:value-of select="."/></b> </xsl:for-each> </a> </xsl:for-each> returns <a><b>1</b></a> <a><b>2</b></a> <a><b>3</b></a> and not - as I supposed - <a><b>1</b><b>2</b></a> <a><b>3</b></a> How can I suppress this "flattening" of the original sequence? The use case is defining a variable with xsl:for-each-group and iterating over the groups (which consists of sequences of elements): <xsl:variable name="Chunks" as="node()+"> <xsl:for-each-group select="//body" group-ending-with="div"> <xsl:sequence select="current-group()"/> </xsl:for-each-group> </xsl:variable> <xsl:for-each select="$Chunks">... do something ...</xsl_for-each> with input <body> <h1>Headline</h1> <div> ... </div> <div> ... </div> </body> I've found a workaround for this issue by wrapping the current-group() in a <group/>-element, but I was wondering if someone can provide a more straight-forward solution. Thanks, Stefan | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
