xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Katarzyna Marszalek" <katarzyn...@heliosnet.pl>
Subject Propagating entity resolvers down to the schema parser
Date Mon, 11 Nov 2002 14:39:05 GMT
In my application a custom EntityResolver handler, set for a SAX parser, is
not propagated to the schema handler (this is for the latest version, 2.2.0
of Xerces.)  As the result of this there are always HTTP connections made to
retrieve http://www.w3.org/2001/XMLSchema.dtd, since the schema file has
doctype of:

<!DOCTYPE schema PUBLIC "-//W3C/DTD XML Schema Version 1.0//EN"
                        "http://www.w3.org/2001/XMLSchema.dtd"[
]>

Am I missing something, or is this by design and there are some other ways
to force the parser to use the custom entity resolver?

Regards,
Katarzyna Marszalek

P.S. For now, I was able to get around the problem by modifying
org.apache.xerces.impl.xs.traversers.XSDHandler.java, adding the following
code to the getSchema method:


                    fSchemaParser = new DOMParser();
                    if( fEntityResolver != null ) {
                        try {

fSchemaParser.setProperty("http://apache.org/xml/properties/internal/entity-
resolver",fEntityResolver);
                        } catch(Exception e) {
                            e.printStackTrace(System.err);
                        }
                    }



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message