Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when getting Processor with XQuery #5

Open
thms-rmb opened this issue Dec 5, 2020 · 2 comments
Open

NullPointerException when getting Processor with XQuery #5

thms-rmb opened this issue Dec 5, 2020 · 2 comments

Comments

@thms-rmb
Copy link
Contributor

thms-rmb commented Dec 5, 2020

I tested XQuery after #4 and I am getting a NullPointerException here:

Processor processor = (Processor) ctxt.getConfiguration().getProcessor();
DocumentBuilder builder = processor.newDocumentBuilder();

Apparently ctxt.getConfiguration().getProcessor() returns null, but I'm not sure why it does this under XQuery and not XSLT.

(I am trying this from here: https://github.com/thms-rmb/xmlkit)

@thms-rmb
Copy link
Contributor Author

I asked about this here: https://stackoverflow.com/questions/65172038

It seems when calling net.sf.saxon.Query, the Processor object is not set on the `Configuration object, leading to this error. The solution for me was to set it manually while extending the class:

thms-rmb/xmlkit@ba21945

But I'm not sure where that leaves this though. Ideally the tree builder shouldn't rely on how you extend the net.sf.saxon.Query class, other than the fact that you're actually registering the extension function?

@adamretter
Copy link
Member

@thms-rmb I think a good first step would be to contribute some unit tests which show the issue, then I can likely help diagnose a fix with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants