[Bug 1460] New: Error code for casting errors

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

           Summary: Error code for casting errors
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


What error code do you get if you try to cast from a source type to a target
type for which casting is not permitted (e.g. cast integer to anyURI)?

The language book (3.12.3 4f) says:

For any combination of input type and target type that is not in the above list,
a cast expression raises a type error [err:XPTY0004].

F+O (section 17) says:

If casting is attempted from an ST to a TT for which casting is not supported,
an error is raised [err:FORG0001].

(Yet another illustration of the problems caused by describing casting in more
than one place.)

The casting tests in the test suite seem to assume the XPTY0004 is correct.

Michael Kay

Received on Tuesday, 17 May 2005 17:18:34 UTC