开发者

I get a SAXException when I export a report to PDF format with 100,000 characters

开发者 https://www.devze.com 2023-02-26 15:47 出处:网络
[org.xml.sax.SAXException: Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)]
 [org.xml.sax.SAXException: Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)]
javax.xml.transform.TransformerException: org.xml.sax.SAXException: Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)
    at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2243)
    at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2069)
    at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171)
    at org.apache.xalan.transformer.TransformerImpl开发者_如何学JAVA.transform(TransformerImpl.java:634)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
    at com.ca.calm.reporter.pdf.PDFGenerator.buildPdf(PDFGenerator.java:1132)
    at com.ca.calm.reporter.pdf.PDFGenerator.generatePdf(PDFGenerator.java:848)
    at com.ca.calm.reporter.pdf.PDFGenerator.exportReport(PDFGenerator.java:626)
    at calmReporter.exportReport(calmReporter.java:521)
    at calmReporter.handleRequest(calmReporter.java:161)
    at com.ca.elm.common.sponsor.SponsorBase.Run(SponsorBase.java:159)
Caused by: org.xml.sax.SAXException: Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)
    at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:335)
    at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
    at org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:307)
    at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
    ... 12 more

I try to export a report to PDF which is in XML format with a column that has more than 100,000 characters. The export fails and I get a SAXException. We are using fop 0.95.

Please help me if you had encountered such problem.


This seems to be discusses in the FOP FAQ:

This exception is usually a follow-up error after another exception. Sometimes the original exception gets swallowed by Xalan's default ErrorListener (should be fixed in the latest Xalan release).

The work-around is to set an explicit ErrorListener on the Transformer.

More details can be found in the link above.

0

精彩评论

暂无评论...
验证码 换一张
取 消