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

Re: regrouping split elements

Subject: Re: regrouping split elements
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 21 Dec 2009 18:24:09 +0100
Re:  regrouping split elements
James Cummings wrote:

But to get this first step done, I've started out a number of
different ways before hitting stumbling blocks with
previous/following-sibling.  Is the right approach (in XSLT2) instead
to do something like xsl:for-each-group on the value of hi/@rend
inside each 'p'?

To fix the output you have I think you could use


<xsl:strip-space elements="p"/>

<xsl:template match="p">
<xsl:for-each-group select="node()" group-adjacent="boolean(self::hi)">
<xsl:when test="current-grouping-key()">
<xsl:for-each-group select="current-group()" group-adjacent="@rend">
<hi rend="{current-grouping-key()}">
<xsl:copy-of select="current-group()/node()"/>
<xsl:copy-of select="current-group()"/>


but you might rather not produce the wrong output at all and instead fix the stylesheet that produces the wrong output.

	Martin Honnen

Current Thread


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.
First Name
Last Name
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.