Bug #2032
closedSpurious type-checking error XPTY0020
100%
Description
Unmatched pattern "text()[/..//../foobar]" produces error as below:
Warning: on line 40 of decoy.xsl:
The child axis starting at a text node will never select anything
Error on line 40 of decoy.xsl:
XPTY0020: Cannot select the parent of the context node: the context item is an atomic value
Files
Updated by Michael Kay over 10 years ago
- Category set to XPath conformance
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Priority changed from Low to Normal
The issue is essentially an error in the static type checking of a path of the form text()/*/..
The inferred type of text()/* is xs:error (the type with no instances). The type checking for ".." is reporting an error if the inferred type of the context item is a subtype of "atomic" (which xs:error is); it should be reporting an error only if the inferred type is disjoint with "node()". xs:error is a subtype of node(), so there should be no error here.
A patch is being applied to SingleNodeExpression.typeCheck().
Updated by Michael Kay over 10 years ago
- Subject changed from Spurious error to Spurious type-checking error XPTY0020
Updated by O'Neil Delpratt over 10 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.5.1.5
Bug fix applied in Saxon maintenance release 9.5.1.5
Please register to edit this issue