StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Loging config, PrettyPrint and Xalan indent #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In Nuxeo we use Log4J via apache.common.logging.
XDocReports detects this config, and uses the Log4JLogger.

When running a report I have an error in Xalan because of the prettyPrint ...

java.lang.IllegalArgumentException: Non pris en charge : indent-number
at 
org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactor
yImpl.java:576)
at fr.opensagres.xdocreport.core.utils.XMLUtils.prettyPrint(XMLUtils.java:63)
at fr.opensagres.xdocreport.core.utils.XMLUtils.prettyPrint(XMLUtils.java:56)
at 
fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor.preproce
ss(AbstractXDocPreprocessor.java:88)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.doPreprocessorIfNeeded(Abst
ractXDocReport.java:314)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:411)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:389)
at 
org.nuxeo.ecm.platform.template.processors.xdocreport.XDocReportProcessor.render
Template(XDocReportProcessor.java:201)

The issue may be specific to JDK6 under linux 64 
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519088 ???).

Anyway, I solved the issue by configuring log level to WARN in my unit tests, 
but it looks to me like the prettyPrint should shield this indent-number issue 
to avoid crashing for a debug log.

Original issue reported on code.google.com by angelo.z...@gmail.com on 10 Jan 2012 at 2:19

GoogleCodeExporter commented 8 years ago
Bug is fixed. Now the XMLUtils.prettyPrint tries to indent the XML entry with 
serveral strategies : 

1) Indent XML with Transformer WITH the "indent-number" property at first. If 
crash do 2) Indent XML with XSLT . If crash do 3)
3) Indent XML with Transformer WITHOUT the "indent-number" property at first. 
If crash do 4)
4) returns the XML source (so no indentation is done)

Original comment by angelo.z...@gmail.com on 10 Jan 2012 at 2:27