## [saxon] Shouldn't xs:unsignedLong("-0") fail?

 [saxon] Shouldn't xs:unsignedLong("-0") fail? From: Frans Englich - 2006-11-23 14:58:00 ```Another XML Schema issue; consider this query: xs:unsignedLong("-0") Is "-0" a lexically valid representation for xs:unignedLong(or unsigned=20 derived integers in general)? The spec says this: 3.3.21.1 Lexical representation unsignedLong has a lexical representation consisting of a finite-length=20 sequence of decimal digits (#x30-#x39). For example: 0, 12678967543233,=20 100000. So, if you ask me, any preceeding sign is prohibited. =46or xs:nonNegativeInteger, a minus sign is allowed though: 3.3.20 nonNegativeInteger [Definition:] nonNegativeInteger is =B7derived=B7 from integer by setting= the=20 value of =B7minInclusive=B7 to be 0. This results in the standard mathemati= cal=20 concept of the non-negative integers. The =B7value space=B7 of nonNegativeI= nteger=20 is the infinite set {0,1,2,...}. The =B7base type=B7 of nonNegativeInteger = is=20 integer. Cheers, Frans ```

 [saxon] Shouldn't xs:unsignedLong("-0") fail? From: Frans Englich - 2006-11-23 14:58:00 ```Another XML Schema issue; consider this query: xs:unsignedLong("-0") Is "-0" a lexically valid representation for xs:unignedLong(or unsigned=20 derived integers in general)? The spec says this: 3.3.21.1 Lexical representation unsignedLong has a lexical representation consisting of a finite-length=20 sequence of decimal digits (#x30-#x39). For example: 0, 12678967543233,=20 100000. So, if you ask me, any preceeding sign is prohibited. =46or xs:nonNegativeInteger, a minus sign is allowed though: 3.3.20 nonNegativeInteger [Definition:] nonNegativeInteger is =B7derived=B7 from integer by setting= the=20 value of =B7minInclusive=B7 to be 0. This results in the standard mathemati= cal=20 concept of the non-negative integers. The =B7value space=B7 of nonNegativeI= nteger=20 is the infinite set {0,1,2,...}. The =B7base type=B7 of nonNegativeInteger = is=20 integer. Cheers, Frans ```
 Re: [saxon] Shouldn't xs:unsignedLong("-0") fail? From: Michael Kay - 2006-11-23 15:28:03 ```A closely-related issue was discussed at some length by the WGs during the last call period: http://www.w3.org/Bugs/Public/show_bug.cgi?id=1207 It looks as if the resolution to that issue has not been implemented in Saxon. But I don't think it has been implemented in the F+O spec either. Section 17.1 is entitled "casting from primitive types to primitive types" and this entitles one to assume that section 17.1.1 "casting from xs:string" is not applicable to this case. If it is not applicable, then 17.2 "casting to derived types" applies; this points to 17.5 "casting across the type hierarchy", which makes this expression equivalent to xs:unsignedLong(xs:integer("-0")), which succeeds. (However, the second para of section 17.1.1 does discuss casting to derived types, and perhaps this takes precedence over anything one might infer from the section heading). Michael Kay > -----Original Message----- > From: saxon-help-bounces@... > [mailto:saxon-help-bounces@...] On Behalf > Of Frans Englich > Sent: 23 November 2006 14:56 > To: 'Mailing list for SAXON XSLT queries' > Subject: [saxon] Shouldn't xs:unsignedLong("-0") fail? > > > Another XML Schema issue; consider this query: > > xs:unsignedLong("-0") > > Is "-0" a lexically valid representation for > xs:unignedLong(or unsigned derived integers in general)? The > spec says this: > > 3.3.21.1 Lexical representation > unsignedLong has a lexical representation consisting of a > finite-length sequence of decimal digits (#x30-#x39). For > example: 0, 12678967543233, 100000. > > So, if you ask me, any preceeding sign is prohibited. > > For xs:nonNegativeInteger, a minus sign is allowed though: > > 3.3.20 nonNegativeInteger > [Definition:] nonNegativeInteger is .derived. from integer > by setting the > value of .minInclusive. to be 0. This results in the standard > mathematical concept of the non-negative integers. The .value > space. of nonNegativeInteger is the infinite set {0,1,2,...}. > The .base type. of nonNegativeInteger is integer. > > > Cheers, > > Frans > > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT Join > SourceForge.net's Techsay panel and you'll get the chance to > share your opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge > &CID=DEVDEV > _______________________________________________ > saxon-help mailing list > saxon-help@... > https://lists.sourceforge.net/lists/listinfo/saxon-help ```
 Re: [saxon] Shouldn't xs:unsignedLong("-0") fail? From: Frans Englich - 2006-11-27 15:31:36 ```On Thursday 23 November 2006 15:56, Frans Englich wrote: > Another XML Schema issue; consider this query: > > xs:unsignedLong("-0") Related is also that apparently the plus-sign is prohibited for (at least) unsigned types, so for example this query should fail: xs:unsignedInt("+4") I'll try to get tests into the XQTS for this as well. Cheers, Frans ```