Subject: Re: [xsl] Adjacent grouping?|
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Nov 2017 18:18:56 -0000
I am trying toB remove attributeB values in a listB based on a frequency parameter.Such a condition can be easier formulated in XQuery 3 with a window clause https://www.w3.org/TR/xquery/#id-tumbling-windows
Is this possibleB in XSLT 2? I cannot see how to tackle theB problemB without being able to store the last attributeB value addedB to the result tree so that I can compare against it for the following attribute values? I am told that there is no way to query the result tree and so I am at a loss as to whether XSLT can actually do what I require?
To illustrate, please see the example below.
The frequencyB parameter is 30. I would like to remove all values that are "within 30" of the last value used. If the first value is 0 then I would like to remove all the following attribute values that are less than 30 plus the last value added to the result tree (in this case 0).
for tumbling window $w in p/Content start $s when true() end next $n when xs:decimal($n/@value) - xs:decimal($s/@value) ge 30 return ($w, subsequence($w, 2)/<Content value=""/>)