This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
7.1.3 The fs:convert-operand function "$actual as item?" In every use of fs:convert-operand in the FS, the first argument is the result of a call to fn:data, which means it must be of type "xdt:anyAtomicType*". So "item?" could be narrowed to "xdt:anyAtomicType?". "is of type" Change to "is an instance of"? (That's the terminology that XQuery uses.) "a. if $expected is of type xdt:untypedAtomic, returns $actual cast to xs:string" After "xdt:untypedAtomic", insert "or xs:string" (with corresponding changes to STA / rules 2 and 4), otherwise I think there is a discrepancy between semantics of fs:convert-operand and the semantics described in XQuery 3.5.2 for General Comparisons. Specifically, if $actual is an instance of xdt:untypedAtomic, and $expected is an instance of a subtype of xs:string, fs:convert-operand will (currently) follow 2c and cast $actual to the type of $expected (the subtype of xs:string), whereas 3.5.2 says that it should be cast to xs:string. With the suggested change, fs:convert-operand will follow 2a and cast $actual to xs:string. (Yes, I'm doubtful that this is an important distinction, but it's a simple change, and it makes it easier to see that fs:convert-operand agrees with the XQuery doc, so why not do it?) "Otherwise, the operand is returned unchanged" Change to "Otherwise, returns $actual". STA "No conversion is needed for numeric (or empty) operands." Actually, no conversion is necessary unless $actual is an instance of xdt:untypedAtomic. STA / rule 1 / premise 2 "statEnv |- Type1 <: (xs:decimal|xs:float|xs:double)?" Change to statEnv |- not( Type1 <: xdt:untypedAtomic? ) STA / rule (2|3) / premise 1 "statEnv |- Expr1 <: Type1" Change "<:" to ":".
Fixed as suggested. - Jerome
I said: > > "a. if $expected is of type xdt:untypedAtomic, returns $actual cast to > xs:string" > After "xdt:untypedAtomic", insert "or xs:string" (with corresponding > changes to STA / rules 2 and 4), The 2006-06 CR does not have those corresponding changes.
Added the proper changes to STA rules 2 and 4. - Jerome