Bug #5829
closedNullPointerException calling XdmFunctionItem.call() on a context-dependent function
0%
Description
When a context-dependent function such as fn:local-name() is obtained using XdmFunctionItem.getSystemFunction()
, a NullPointerException occurs when the function is called.
Occurs with both the Java and .NET APIs.
Updated by Michael Kay almost 2 years ago
Added unit tests; fixed the code to throw a SaxonApiException with error code XPDE0002.
Updated by Michael Kay almost 2 years ago
I have taken the opportunity to convert all the JUnit tests in TestXdmFunction into NUnit tests and run them against SaxonCS 12; this is revealing some additional minor issues.
- XdmFunctionItem.Invoke does not throw a SaxonApiException if execution fails with a dynamic error
- A System.InvalidCastException is thrown if the argument to a function is of the wrong type
Updated by Michael Kay almost 2 years ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch 11, 12, trunk added
Updated by Michael Kay almost 2 years ago
I've added the new NUnit tests to the SaxonCS 11 branch as well as SaxonCS 12.
Updated by Michael Kay almost 2 years ago
- Status changed from Resolved to In Progress
- Fix Committed on Branch deleted (
11, 12, trunk)
The SaxonJ method XdmFunctionItem.call() had been enhanced to apply the function conversion rules to the supplied parameters. This is not happening in SaxonCS. The actual implementation code for system functions assumes that the arguments have been type-checked, and that it can safely cast the supplied values to the required type. On SaxonCS we're throwing a Cast exception because this isn't the case.
I've now changed the C# XdmFunctionItem.Invoke() to apply the function conversion rules in the same way that SaxonJ does.
Updated by Michael Kay almost 2 years ago
- Status changed from In Progress to Resolved
Updated by O'Neil Delpratt 12 months ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 12.1 added
Please register to edit this issue