Running FOP with a DTD catalog

Jan Driesen <[email protected]>
Newsgroups gmane.text.xml.fop.user
Message-ID <VI1PR0501MB2527E5CA4FDFD602252F3AD2F74A0@VI1PR0501MB2527.eurprd05.prod.outlook.com>
Hello everybody,


I am trying to process files with a DTD reference from the (Windows) command line.
C:\[...]\fop-2.2\fop.bat -xml "C:\Users\[...]\inputfile.xml" -xsl transformation.xslt -pdf outputfile.pdf -catalog

In order to do so, I use the -catalog option for FOP(2.2). I have a CatalogManager.properties in my running folder (using verbose=4), pointing to the catalog file.
When running FOP, output reports the mapping to the correct DTD entries, so I am sure that catalog is being read.

After that, FOP errors out:

SEVERE: Exception
org.apache.fop.apps.FOPException: I/O error reported by XML parser processing file:/C:/Users/[...]/inputfile.xml: C:\Users\[...]\validation.dtd (The system cannot find the file specified)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:296)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116)
        at org.apache.fop.cli.Main.startFOP(Main.java:186)
        at org.apache.fop.cli.Main.main(Main.java:217)
Caused by: net.sf.saxon.trans.XPathException: I/O error reported by XML parser processing file:/C:/Users/[...]/inputfile.xml: C:\Users\[...]\validation.dtd (The system cannot find the file specified)
        at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:476)
        at net.sf.saxon.event.Sender.send(Sender.java:177)
        at net.sf.saxon.Controller.transform(Controller.java:1846)
        at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:553)
        at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:183)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:293)
        ... 3 more
Caused by: java.io.FileNotFoundException: C:\Users\[...]\validation.dtd (The system cannot find the file specified)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(Unknown Source)
        at java.io.FileInputStream.<init>(Unknown Source)
        at java.io.FileInputStream.<init>(Unknown Source)
        at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)

Indeed the (public) DTD is not in the same folder, but the catalog file which points to the location of the DTD's should solve that. As you can see from the error, I am currently testing this with Saxon.
When running Saxon on its own to isolate the xml->fo part, I can make the catalog work as well by running:
"C:\[..]\java.exe" -cp C:\[...]\saxon9he.jar;C:\[...]\resolver.jar -Dxml.catalog.files="C:\[...]\CatalogueFile.xml" net.sf.saxon.Transform -r:org.apache.xml.resolver.tools.CatalogResolver -x:org.apache.xml.resolver.tools.ResolvingXMLReader -y:org.apache.xml.resolver.tools.ResolvingXMLReader -xsl:inputfile.xml -s:transformation.xslt -o:outputfile.fo

I have the impression that fop is not forwarding catalog setting to Saxon... Can any of you make some suggestions on how to set this up or what to test?


Thanks,


Jan Driesen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.