|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] for-each over sequences of sequences
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
|
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
|






