[Bug 13204] New: [XP 3.0] XPTY0019 vs XPTY0020

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

           Summary: [XP 3.0] XPTY0019 vs XPTY0020
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


With the introduction of try/catch, predictability of error codes is becoming
increasingly important. There seems to be a big overlap between XPTY0019 and
XPTY0020.

Given the expression

23/x

when we look at the rules for the "/" operator, we raise XPTY0019 because the
LHS is not a node; but when we look at the rules for the axis step "x", we
raise XPTY0020 because the context item is not a node. There's no indication of
which of these takes precedence. However, when the RHS of "/" is something
other than an Axis Step, XPTY0019 is the only permitted error code; but when an
Axis Step appears other than on the RHS of "/" (for example 23[x]), XPTY0020 is
the only permitted code.

I'm finding it almost impossible to keep enough information through tree
rewrites to maintain these distinctions: for example it means that "for $x in
ABC where $x/@a return $x" cannot safely be rewritten as ABC[@a].

So I would like to propose that all uses of XPTY0019 be replaced by XPTY0020.

-- 
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 Monday, 11 July 2011 10:16:28 UTC