Project

Profile

Help

Suppressing schema warning

Added by Rob Brown about 5 years ago

I have a custom error listener that works and it hears all kinds of useful warnings. Most of the time the warning does not show up in the log file.

However the following warning is not heard by the listener and it does go in the log:

Warning at xs:import on line 1 column 355 of wrapper.xsd: The schema document at abc.xsd is not being read because schema components for this namespace are already available. To force the schema document to be read, set --multipleSchemaImports:on <<

Note that something close to this does get sent to the error listener:

The schema document at def.xsd is ignored because a schema for this namespace is already loaded <<

I have a wrapper.xsd schema that does not import either abc.xsd and def.xsd, My main xsl file has import-schema elements for wrapper.xsd and abc.xsd. Another xsl that is imported has an import-schema element for def.xsd. I have xpath expressions that mix wrapper.xsd with the other 2 schemas (i.e. wrapper.xsd is only for the document element).

I register the listener as follows:

XsltCompiler compiler = processor.newXsltCompiler(); compiler.setErrorListener(errorListener); XsltExecutable executable = compiler.compile(xslSource); XsltTransformer transformer = executable.load(); transformer.setErrorListener(errorListener); transformer.setDestination(new DOMDestination(result)); transformer.transform();

Is there another object where I need to register the error listener?


Replies (2)

RE: Suppressing schema warning - Added by Michael Kay about 5 years ago

Possibly related to https://saxonica.plan.io/issues/4099 -- or at least, it's in the same general area.

I think that when a schema is read via xsl:import-schema, we aren't transferring the XSLT compiler's ErrorListener to the schema compiler.

RE: Suppressing schema warning - Added by Michael Kay about 5 years ago

Logged here as a bug:

https://saxonica.plan.io/issues/4323

Please follow progress by watching the bug tracker.

    (1-2/2)

    Please register to reply