当我将报表导出为包含 100,000 个字符的 PDF 格式时,出现 SAXException
[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.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
我尝试将报告导出为 XML 格式的 PDF,其中一列包含超过 100,000 个字符。导出失败,我收到 SAXException。我们使用的是 fop 0.95。
如果您遇到过此类问题,请帮助我。
[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.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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎在 FOP 常见问题解答中进行了讨论:
解决方法是在
Transformer
上设置显式ErrorListener
。更多详细信息可以在上面的链接中找到。
This seems to be discusses in the FOP FAQ:
The work-around is to set an explicit
ErrorListener
on theTransformer
.More details can be found in the link above.