Actions
Support #5272
closedXQuery ErrorReporter needs to be set in 3 places
Start date:
2022-02-03
Due date:
% Done:
0%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
Not sure if this is still the case with Saxon 11.1. In this code:
Processor proc = new Processor(configuration);
proc.getUnderlyingConfiguration().setErrorReporterFactory(config -> {return new ErrorReporterToListener(errorListener);});
proc.setConfigurationProperty(Feature.NAME_POOL, proc.getUnderlyingConfiguration().getNamePool());
proc.setConfigurationProperty(Feature.SOURCE_PARSER_CLASS, CatalogEnabledXMLReader.class.getName());
proc.setConfigurationProperty(Feature.LINE_NUMBERING, Boolean.TRUE);
proc.setConfigurationProperty(Feature.TREE_MODEL, Builder.LINKED_TREE);
// XQuery compiler
XQueryCompiler comp = proc.newXQueryCompiler();
comp.setErrorReporter(new ErrorReporterToListener(errorListener));
comp.setBaseURI(new URI(querySystemID));
XQueryExecutable xPathExecutable = comp.compile(parameter.getValue());
XQueryEvaluator pathSelector = xPathExecutable.load();
pathSelector.setErrorListener(errorListener);
in order to avoid various errors being reported in the console I needed to set the error listener on proc.getUnderlyingConfiguration(), on the XQueryCompiler and on the XQueryEvaluator, otherwise in some stages the errors were dumped to the standard error listener.
Please register to edit this issue
Actions