ITADN

Drop XPTY0019 and XPTY0020 in favour of XPTY0004

#2624Openmichaelhkay 创建于 2026-05-10
XPathXQueryEnhancementPR Pending
M
michaelhkaycommented
I propose that we drop error codes XPTY0019 and XPTY0020 in favour of XPTY0004. Firstly, there's a big overlap between XPTY0019 and XPTY0020: with a path expression such as $x/child::node(), if $x selects items that aren't nodes, it's perfectly legitimate to raise either. Furthermore, the rule in §2.4.3.2 If an operand of an expression does not have a [dynamic type] that is a [subtype] of the [static type] required for that operand, a [type error] is raised [err:XPTY0004] would legitimise XPTY0004 for this situation. We state in §4.7.5 Axis Steps: "The [axis step] S is equivalent to ./S", but that isn't true because the error codes are different. It's unlikely that anyone would use try/catch to catch either XPTY0019 or XPTY0020, firstly because of the overlap, and secondly because type errors will often be raised statically.
1 条评论