Expected exception with variable resolver returning null
I'm new to the community so hope this is the right way to create an issue. I noticed that there seems to be a behavior difference in the XPathFactory between a JDK (specifically openjdk version "1.8.0_345") and Saxon (specifically 11.4) creating a factory with net.sf.saxon.xpath.XPathFactoryImpl instead of the default XPathFactory.
When I do a variable lookup for a variable that doesn't exist, I would expect to get an exception thrown but in Saxon I get an empty result back. If I'm not mistaken, Saxon follows the JAXP 1.3 spec for this implementation and according to the spec when evaluating expressions for variables, "... An javax.xml.xpath.XPathExpressionException is raised if the variable resolver is undefined or the resolver returns null for the variable." The fix is pretty easy for this based of the 11.4 latest code.
Wanted to start a discussion for this to see what the community thought about this and if possible, I can provide a fix for it as well. I'm attaching a sample java class which hopefully provides more insights.
Thanks in advance!
Please register to edit this issue