[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping: XHTML inline, block and flow
On 27/03/2008, Raka Gator <plogbil@xxxxxxxxx> wrote: > <td>This is a <strong>wonderful</strong> table <p>but evil</p></td> > > I'd like that transformed into something like this (omitting lots of attributes > for clarity): > > <table:table-cell> > <text:p>This is a <text:span text:style-name="bold">wonderful > </text:span> table</text:p> > <text:p>but evil</text:p> > </table:table-cell> This is one for "group-adjacent": <xsl:for-each-group select="node()" group-adjacent="not(self::p)"> <xsl:choose> <xsl:when test="current-grouping-key()"> <text:p><xsl:apply-templates select="current-group()"/></text:p> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> ...which is a slightly modified version of the last example from here: http://www.w3.org/TR/xslt20/#grouping-examples cheers -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
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
|