Subject: Re: [xsl] 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 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Two possible group-ending, rick@xxxxxxxxxxxxxx | Thread | Re: [xsl] Two possible group-ending, Michael Kay michaelk |
Re: [xsl] Two possible group-ending, Michael Kay michaelk | Date | Re: [xsl] Two possible group-ending, rick@xxxxxxxxxxxxxx |
Month |