[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Grouping: XHTML inline, block and flow

Subject: Re: Grouping: XHTML inline, block and flow
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 27 Mar 2008 10:46:24 +0000
Re:  Grouping: XHTML inline
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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.