|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
resolver should be able to parse catalog files without needing to resolve external entities?I'm getting the following exception using the XML catalog resolver with
FOP, [...] DELEGATE_PUBLIC: -//W3C//DTD XHTML//EN file:/usr/share/xml/xhtml/schema/dtd/catalog.xml resolvePublic(-//W3C//DTD XHTML 1.0 Transitional//EN,null) Switching to delegated catalog(s): file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml Parse catalog: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml Loading catalog: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml Default BASE: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml 22-Oct-2009 5:04:13 PM org.apache.fop.cli.Main startFOP SEVERE: Exception javax.xml.transform.TransformerException: java.net.UnknownHostException: globaltranscorp.org at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:314) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:146) at org.apache.fop.cli.Main.startFOP(Main.java:174) at org.apache.fop.cli.Main.main(Main.java:205) [...] I think it's the same issue reported here, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491091 - and here, https://bugs.launchpad.net/ubuntu/+source/w3c-dtd-xhtml/+bug/400259 Is comment #4 correct? "Arguably this is a bug in org.apache.xml.resolver, cf. http://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.bootstrap - the resolver should be able to parse catalog files without needing to resolve external entities" https://bugs.launchpad.net/ubuntu/+source/w3c-dtd-xhtml/+bug/400259/comments/4 |
|
|
Re: resolver should be able to parse catalog files without needing to resolve external entities?On October 23, 2009 at 09:52, Jack Bates wrote:
> I'm getting the following exception using the XML catalog resolver with > FOP, > DELEGATE_PUBLIC: -//W3C//DTD XHTML//EN > file:/usr/share/xml/xhtml/schema/dtd/catalog.xml > resolvePublic(-//W3C//DTD XHTML 1.0 Transitional//EN,null) > Switching to delegated catalog(s): > file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml > Parse catalog: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml > Loading catalog: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml > Default BASE: file:/usr/share/xml/xhtml/schema/dtd/1.0/catalog.xml > 22-Oct-2009 5:04:13 PM org.apache.fop.cli.Main startFOP > SEVERE: Exception > javax.xml.transform.TransformerException: java.net.UnknownHostException: > globaltranscorp.org Is globaltranscorp.org resolvable on the system you are running FOP? Apparently the underlying network library of the JVM cannot resolve the hostname. As for the "resolve external entities" problem, it appears to be a chicken-n-egg problem. The resolver depends on the underlying XML parser to parse the XML catalog file, but at that time, the base entity resolution of the XML parser is being used since the resolver is still bootstrapping itself. If your catalog file contains a DOCTYPE declaration with a public and system identifier, then the XML parser will try to resolve it, and if the system identifier listed is not accessible, you will get an error. All of this is a function of the XML parser itself and NOT the resolver library. In practice, I normally do not specify a doctype declaration for catalog files to avoid the unnecessary overhead of parsing a DTD. If you absolutely need to have DTD validation of your catalog files, make sure the system identifier is resolvable, and preferably to a location on the local file system for better performance and to avoid dependency on a remote system. --ewh |
|
|
|
|
|
Re: resolver should be able to parse catalog files without needing to resolve external entities?The OASIS catalog DTD is included in resolver.jar and there is a BootstrapResolver [1] which gets installed on the parser that reads the catalog which can return this DTD. I'm sure the reason that isn't happening is that the public and system IDs differ from the ones that the resolver knows about. You're supposed to extend BootstrapResolver (in your own application) if you need support for more than the well-known public IDs and URIs for the catalog DTDs / schemas and set an instance of this extension on the CatalogManager [2]. |
|
|
Re: resolver should be able to parse catalog files without needing to resolve external entities?On Sat, 2009-10-24 at 15:10 -0400, Michael Glavassevich wrote:
> The OASIS catalog DTD is included in resolver.jar and there is a > BootstrapResolver [1] which gets installed on the parser that reads > the catalog which can return this DTD. I'm sure the reason that isn't > happening is that the public and system IDs differ from the ones that > the resolver knows about. You're supposed to extend BootstrapResolver > (in your own application) if you need support for more than the > well-known public IDs and URIs for the catalog DTDs / schemas and set > an instance of this extension on the CatalogManager [2]. Thank you Michael! After some more digging, I think the reason that the w3c-dtd-xhtml catalog.xml isn't using the well known catalog DTD public ID and URI, <!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> is that it's trying to use a different DTD? <!DOCTYPE catalog PUBLIC "-//GlobalTransCorp//DTD XML Catalogs V1.0-Based Extension V1.0//EN" "http://globaltranscorp.org/oasis/catalog/xml/tr9401.dtd"> The xml-core package distributes "tr9401.dtd", in addition to "catalog.dtd" - here it is, http://www.sfu.ca/~jdbates/tmp/debian/200910280/tr9401.dtd - and here are the differences between it, and the "catalog.dtd" included in resolver.jar, http://www.sfu.ca/~jdbates/tmp/debian/200910280/diff I dunno if the w3c-dtd-xhtml catalog.xml actually requires this different DTD, but it sounds like if it does, and the system ID isn't accessible, then it will only be parsable by tools which extend BootstrapResolver to add support for this different DTD? |
|
|
Re: resolver should be able to parse catalog files without needing to resolve external entities?Jack, |
| Free embeddable forum powered by Nabble | Forum Help |