我在命令行上使用Apache FOP将xsl:fo文件转换为pdf。
那些xsl:fo文件包含导致致命错误的<!DOCTYPE []>
构造:
org.xml.sax.SAXParseException; systemId: file:/Y:/fo-files/Untitled.fo; lineNumber: 2; columnNumber: 10;
DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:293)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116)
at org.apache.fop.cli.Main.startFOP(Main.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.fop.cli.Main.startFOPWithDynamicClasspath(Main.java:143)
at org.apache.fop.cli.Main.main(Main.java:219)
必须将xerces "http://apache.org/xml/features/disallow-doctype-decl"
功能设置为false。
如何从FOP命令行或环境(配置,属性或其他)设置该功能?