[xsl] Re: Seeking an elegant XSLT function to check that a pair of numeric ranges are consecutive

Subject: [xsl] Re: Seeking an elegant XSLT function to check that a pair of numeric ranges are consecutive
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 25 May 2024 17:05:19 -0000
Wow! Below is David Carlisle's solution. He solved the problem in a single
statement. Totally mind-blowing! Pure elegance!

<xsl:function name="f:do-ranges-connect" as="xs:boolean">
    <xsl:param name="previous-range"/>
    <xsl:param name="current-range"/>

    <xsl:sequence select="xs:int(replace($previous-range,'.*-',''))+1=
                                            xs:int(replace($current-range,'-.
*',''))"/>
</xsl:function>

Current Thread