Subject: Re: [xsl] Grouping lists from flat to nested From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Mon, 31 Jan 2011 17:28:06 +0100 |
this looks great, thank you! - the only downside is that the input to this grouping attempt is a variable containing the input. So I fear I can't use<template match="text"> here. I think I would need a new transformation document in the pipeline with this attempt - which I would love to avoid. - Or am I mistaken?
<xsl:template match="test"> <xsl:copy> <xsl:for-each-group select="*" group-adjacent="boolean(self::item)"> <xsl:choose> <xsl:when test="current-grouping-key()"> <xsl:sequence select="mf:group(current-group(), 0)"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:copy> </xsl:template>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Grouping lists from flat , Stefanie Haupt | Thread | [xsl] EMF, Rolf Schumacher |
Re: [xsl] Grouping lists from flat , Stefanie Haupt | Date | [xsl] Complex Regex takes 201 steps, Alex Muir |
Month |