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

Re: Two possible group-ending-with nodes

Subject: Re: Two possible group-ending-with nodes
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Jan 2023 15:39:42 -0000
Re:  Two possible group-ending-with nodes
Am 1/6/2023 um 4:00 PM schrieb rick@xxxxxxxxxxxxxx:
>
> Martin,
>
> The notes-content will be one or more of p with class=CBNoteBody or p
> class="CBBodyIndented" style="margin-left:96pxb with nothing else in
> between.
>

Perhaps a nested group-adjacent inside the group-starting-with, together
with a variable helps:


 B B B  <xsl:template match="/root">
 B B B B B B B  <xsl:copy>
 B B B B B B B B B B B  <xsl:for-each-group select="*"
group-starting-with="p[@class='CBNote']">
 B B B B B B B B B B B B B B B  <xsl:choose>
 B B B B B B B B B B B B B B B B B B B  <xsl:when
test="self::p[@class='CBNote']">
 B B B B B B B B B B B B B B B B B B B B B B B  <xsl:variable name="note"
select="."/>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:for-each-group
select="tail(current-group())"
group-adjacent="boolean(self::p[@class='CBNoteBody']|self::p[@class='CBBodyIn
dented'][@style='margin-left:96px;'])">
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:choose>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B  <xsl:when
test="position() = 1 and
current-grouping-key()">
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B  <div
class="note">
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
<div class="note-header">
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
B B B  <xsl:copy-of select="$note"/>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
</div>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
<div class="note-content">
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
B  <xsl:copy-of
select="current-group()"/>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
</div>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B  </div>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
</xsl:when>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
<xsl:otherwise>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
<xsl:copy-of select="current-group()"/>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B 
</xsl:otherwise>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B  </xsl:choose>
 B B B B B B B B B B B B B B B B B B B B B B B B B B B  </xsl:for-each-group>
 B B B B B B B B B B B B B B B B B B B  </xsl:when>
 B B B B B B B B B B B B B B B B B B B  <xsl:otherwise>
 B B B B B B B B B B B B B B B B B B B B B  <xsl:copy-of
select="current-group()"/>
 B B B B B B B B B B B B B B B B B B B  </xsl:otherwise>
 B B B B B B B B B B B B B B B  </xsl:choose>
 B B B B B B B B B B B  </xsl:for-each-group>
 B B B B B B B  </xsl:copy>
 B B B  </xsl:template>

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.