[Bug 11733] New: [F+O 3.0] Casting to union types

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11733

           Summary: [F+O 3.0] Casting to union types
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.0
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


XPath 3.0 allows casting to union types.

There are several loose ends in the current specification.

(a) We currently allow casting only from string or untypedAtomic. In most other
places in the language, we allow an xs:anyURI to be used anywhere an xs:string
can be used. Should we allow it for casts also? Should this apply to all casts?

(b) Should we allow casting of a value A to a union type U if the type of A is
a member type of U? This is a no-op, but users might expect to be able to do
this, by analogy with the ability to "up-cast" say from my:hatsize to
xs:integer.

(c) In the SequenceType syntax (as my:unionType) we allow a union only if it is
a "plain" union, that is, a union whose ultimate member types are atomic values
with no further restrictions imposed by the union (that is disallowing a union
derived by restriction from another union). Should we restrict casting to
"plain union" types for consistency, or should we allow casting to any union
type? (If we do the latter, it would probably make sense to allow casting to
any simple type, including a list. The semantics are perfectly well defined.)

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 11 January 2011 11:25:34 UTC