[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xslt 3.0, and use of 'as' attribute with xsl:varia
On Fri, 1 Sept 2023 at 09:13, Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > 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. > > > The rules are a bit arbitrary, but you are calling them xpath 3.1 rules as if they are new(ish) but this all comes from xpath/xslt 2, and changing the way type conversion works after decades of use would be problematic. David > -- > Regards, > Mukul Gandhi > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/2739265> (by > email <>)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|