On 05/06/2026 16:09, rick@xxxxxxxxxxxxxx wrote:
>
> Here is my XML:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xrefs>
> B B B <xref>16.1.0</xref>
> B B B <xref>16.2.1</xref>
> B B B <xref>16.2.2</xref>
> B B B <xref>16.2.3</xref>
> B B B <xref>16.14.2</xref>
> B B B <xref>16.22.0</xref>
> </xrefs>
>
> I need to determine ranges, like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xrefs>
> B B B <xref>16.1.0</xref>
> B B B <xref>16.2.1</xref>
> B B B <range/>
> B B B <xref>16.2.3</xref>
> B B B <xref>16.14.2</xref>
> B B B <xref>16.22.0</xref>
> </xrefs>
>
> I am trying to determine an XSLT 3.0 algorithm for doing this. I am
> looking for suggestions. Thank you in advance.
>
Hi Rick,
is that always a range based on the last number? Is there some spec as
to what the number can be e.g. 0..9?
Looks like a job for xsl:for-each-group group-adjacent, perhaps with
some accumulator.
|