Re: [xsl] xslt 3.0, and use of 'as' attribute with xsl:variable

Subject: Re: [xsl] xslt 3.0, and use of 'as' attribute with xsl:variable
From: "Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Sep 2023 08:13:24 -0000
Hi Wendell,

On Thu, Aug 31, 2023 at 7:24b/PM Piez, Wendell A. (Fed)
wendell.piez@xxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:


> My thought is, why not
>
>
>
> <xsl:variable name="var1" select="4"/>
>
>
>

I'm currently not writing an XSLT stylesheet for a particular business
application, i.e, my goal as per this mail thread is, not to have
<xsl:variable name="var1" .. and a corresponding <xsl:value-of
select="$var1 + 3"/> to work somehow.

I'm trying to understand, how an XSLT 3.0/XPath 3.1 implementation should
function when an XSLT 3.0 instruction xsl:variable has an "as" attribute
(that refers to a sequence type, for e.g xs:integer).

As per XSLT 3.0 spec referring about xsl:variable instruction, which says
"If the as attribute is specified, then the supplied value of the variable
is converted to the required type, using the function conversion rules.".

As I've mentioned within another mail on this thread, I think XPath 3.1
function conversion rules prohibiting a string value '4' to be cast to an
xs:integer type is not very much right. These XPath 3.1 function conversion
rules should be consistent with the result of following XPath expression,

'4' cast as xs:integer.

Or vice-versa, if these XPath 3.1 function conversion rules are correct,
then the XPath 3.1 expression '4' cast as xs:integer should raise an
error.


--
Regards,
Mukul Gandhi

Current Thread