Bug #2179
closederr: variables undeclared within an AVT
100%
Description
From Gunther Rademacher on saxon-help list:
This XQuery
try {parse-xml("")} catch * {}
is rejected with a message of
XPST0008: Variable $err:code has not been declared
The following however works as expected:
try {parse-xml("")} catch * {{$err:code}
}
Tested on Saxon-HE 9.6.0.1, but also occurs with Saxon-EE 9.5.
Best regards,
Gunther
Updated by Michael Kay about 10 years ago
- Subject changed from err: prefix undeclared within an AVT to err: variables undeclared within an AVT
- Status changed from New to Resolved
Added test case try-catch-err-code-variable-13 to QT3 test suite.
The problem is that a new parser is instantiated to process expressions within "AVT"s (necessary because they can contain forwards references to namespace prefixes declared in later attributes), and the new parser doesn't know that it's processing something within a catch clause and that variables like $err:code are therefore in scope.
Patch produced and tested on the 9.7 branch, and retrofitted to 9.6 and 9.5.
Updated by O'Neil Delpratt about 10 years ago
Bug fix applied in the Saxon 9.5.1.8 maintenance release.
Saxon 9.6 release pending.
Updated by O'Neil Delpratt about 10 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.6.0.2
Bug fix applied to the maintenance release Saxon 9.6.0.2
Updated by O'Neil Delpratt almost 9 years ago
- Sprint/Milestone set to 9.6.0.2
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.2 added
Please register to edit this issue