Re: [xsl] Re: Adjacent grouping?

Subject: Re: [xsl] Re: Adjacent grouping?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Nov 2017 14:00:39 -0000
On 19.11.2017 14:38, rus tle profrustyleafiii@xxxxxxxxxxx wrote:
Hi Michael,

I have actually hit a further snag with this solution.

It appears to work well when all the content nodes have the same parent node as in the original question. However, on coming to apply this solution to my real world scenario each content node is actually a child of itbs own p node. I have tried - but I cannot work out how to tweak your solution to adjust to this new revelation. Any thoughts?

The new xml:

 1. <pfrequency=b30">
 2. <Contentvalue="0b/>
 3. </p>
 4. <pfrequency=b30">
 5. <Contentvalue=b10b/>
 6. </p>

You could adjust the iteration and the value selection with e.g.

<xsl:stylesheet xmlns:xsl="";
exclude-result-prefixes="xs math"

<xsl:strip-space elements="*"/>
<xsl:output indent="yes"/>

<xsl:template match="root">
<xsl:iterate select="p">
<xsl:param name="previous" as="xs:integer?" select="()"/>
<xsl:when test="empty($previous) or xs:integer(Content/@value) gt $previous+30">
<xsl:copy-of select="."/>
<xsl:with-param name="previous" select="Content/@value"/>
<xsl:copy-of select="@*"/>
<Content value=""/>


Current Thread