This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1745 - [FS] editorial: 7.1.3 The fs:convert-operand function
Summary: [FS] editorial: 7.1.3 The fs:convert-operand function
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 04:06 UTC by Michael Dyck
Modified: 2007-02-25 23:16 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-07-19 04:06:22 UTC
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 ":".
Comment 1 Jerome Simeon 2006-04-10 15:50:01 UTC
Fixed as suggested.
- Jerome
Comment 2 Michael Dyck 2006-10-05 08:01:27 UTC
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.
Comment 3 Jerome Simeon 2007-01-16 17:59:27 UTC
Added the proper changes to STA rules 2 and 4.
- Jerome