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

Saxon throws exception with new 1.5.0 validator (Java) #116

Open
VoidTenshi opened this issue Jun 2, 2023 · 4 comments
Open

Saxon throws exception with new 1.5.0 validator (Java) #116

VoidTenshi opened this issue Jun 2, 2023 · 4 comments

Comments

@VoidTenshi
Copy link

With the changes of the ConfigurationLoader.build() method I tried to implement the internal previously used processor from the createProcessor() method of the StrictRelativeResolvingStrategy class. No matter what the underlying configuration is set to, I get the following exception:

net.sf.saxon.s9api.SaxonApiException: Supplied node must be built using the same or a compatible Configuration

at net.sf.saxon.s9api.XPathSelector.setContextItem(XPathSelector.java:77)
at de.kosit.validationtool.impl.ScenarioRepository.match(ScenarioRepository.java:101)
at de.kosit.validationtool.impl.ScenarioRepository.lambda$selectScenario$3(ScenarioRepository.java:85)
at de.kosit.validationtool.impl.ScenarioRepository$$Lambda$2374/0x0000000096fcedd0.test(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:185)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1395)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:524)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:514)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:719)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:245)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:510)
at de.kosit.validationtool.impl.ScenarioRepository.selectScenario(ScenarioRepository.java:85)
at de.kosit.validationtool.impl.tasks.ScenarioSelectionAction.determineScenario(ScenarioSelectionAction.java:61)
at de.kosit.validationtool.impl.tasks.ScenarioSelectionAction.check(ScenarioSelectionAction.java:47)
at de.kosit.validationtool.impl.DefaultCheck.runCheckInternal(DefaultCheck.java:125)
at de.kosit.validationtool.impl.DefaultCheck.checkInput(DefaultCheck.java:116)

The patchnotes spoke only of a possibility to use an external processor:

(API) Possibility to use preconfigured Saxon Processor instance for validation

Is there a way to use the 1.4.2 internal processor?

@Markus-P
Copy link

Any thoughts to this issue? Wer are preparing for starting productional use of XRechnung 2.3.1 at 1st of August, which contains the 1.5.0 validator. So we cannot validate the produced XRechnung XML at the moment.

@Markus-P
Copy link

I've tried this as a solution:

Configuration config = loader.build(ProcessorProvider.getProcessor());

Could someone please confirm this as a valid way? Thanks.

@VoidTenshi
Copy link
Author

It worked for me too. If this is valid it should probably be added to the documentation.

@andreasbehnke
Copy link

I think the markdown documentation README.md and https://github.com/itplr-kosit/validator/blob/main/docs/api.md
are outdated and should be updated. The code examples do not work with current version.

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

3 participants