RE: [xsl] Un-nesting elements in XSLT 2.0

Subject: RE: [xsl] Un-nesting elements in XSLT 2.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 11 Nov 2006 00:16:37 -0000
Snap.

Time for bed.

Mike
> 
> It's a grouping question, you want to group things into 
> groups of adjacent nodes that are either block level nodes 
> (which you process directly) or inline nodes (which you put in a <p>
> 
> <xsl:template match="para">
> <xsl:for-each-group select="node()" group-adjacent="self::img 
> or self::table"> <xsl:choose> <xsl:when 
> test="current-grouping-key()"> <xsl:apply-templates 
> select="current-group()"/> </xsl:when> <xsl:otherwise> <p> 
> <xsl:apply-templates select="current-group()"/> </p> 
> </xsl:otherwis> </xsl:choose> </xsl:template>
> 
> David

Current Thread