Project

Profile

Help

Support #5692

open

Warning for xslt included or imported more than once

Added by hamdi karray 10 days ago. Updated 10 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2022-09-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Hello,

is there a way to desactivate the warnings about xslt included or imported more than once :

For example : 2022-09-20 08:41:38,492 [main] WARN eu.els.sie.saxon.utils.Log4jStandardErrorListener - Warning at xsl:stylesheet on line 9 column 17 of els-common_constants.xsl: Stylesheet module cp:/xslLib/els-common_constants.xsl is included or imported more than once. This is permitted, but may lead to errors or unexpected behavior

I tried even a log4j2 regex filter but not working because of non regular carriage return chars in the message.

Thanks

Actions #1

Updated by Michael Kay 10 days ago

Given a s9api XsltCompiler, you can do something like:

ErrorReporter reporter = xsltCompiler.getErrorReporter();
xsltCompiler.setErrorReporter(
  error -> {
     if (!(error.isWarning() && error.getMessage().contains("is included or imported more than once")) {
        reporter.report(error);
     }
  };)

We should do better at making sure all warnings have an error code, which would give you a more reliable way of filtering them.

Please register to edit this issue

Also available in: Atom PDF