xml-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Hett <h.h...@gis-systemhaus.de>
Subject CatalogResolver with crimson
Date Tue, 14 May 2002 10:26:30 GMT
Hi!

Has anyone used the crimson parser (1.1.3)  together with the Norman 
Walsh's CatalogResolver from xml-commons?
I have written a simple Java-Program, that validates an xml file:

...
	SAXParserFactory factory = SAXParserFactory.newInstance();
	factory.setValidating(true);
	factory.setNamespaceAware(true);
	SAXParser parser = factory.newSAXParser();

	System.out.println("setting CatalogResolver");
	CatalogResolver cr = new CatalogResolver();
	parser.getXMLReader().setEntityResolver(cr);

	System.out.println("parser class is " + parser.getClass().getName());
	System.out.println("entity resolver class is " + parser.getXMLReader().getEntityResolver().getClass().getName());
	parser.parse("c:/temp/test.xml", new MyHandler());
...

But all I get is a fatal error:

setting CatalogResolver
Parse catalog: http://jet.ibfs.de/dtd/catalog.xml
Loading catalog: http://jet.ibfs.de/dtd/catalog.xml
Default BASE: http://jet.ibfs.de/dtd/catalog.xml
system: metamodel.dtd
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
SYSTEM: metamodel.dtd
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
system: urn:gis-xml:metamodel.dtd
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
SYSTEM: urn:gis-xml:metamodel.dtd
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
public: -//GIS//DTD XML MetaModel V1.0//EN
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
PUBLIC: -//GIS//DTD XML MetaModel V1.0//EN
        http://jet.ibfs.de/dtd/openframe/metamodel/metamodel.dtd
parser class is org.apache.crimson.jaxp.SAXParserImpl
entity resolver class is org.apache.xml.resolver.tools.CatalogResolver
FATAL:3:-1:External entity not found: "file:/c:/temp/metamodel.dtd".

The xml file lies in c:/temp and starts as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE metamodel PUBLIC "-//GIS//DTD XML MetaModel V1.0//EN" "metamodel.dtd">
<metamodel version="1.0">
...

Thanks in advance for any hints!

-- 
Harald Hett <h.hett@gis-systemhaus.de>
Gesellschaft für integrierte Systemplanung



Mime
View raw message