xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandy...@ca.ibm.com
Subject Re: Propagating entity resolvers down to the schema parser
Date Mon, 11 Nov 2002 15:29:24 GMT
Thx for pointing it out. Fixed in CVS now.

Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com



                                                                                         
                                             
                      "Katarzyna                                                         
                                             
                      Marszalek"               To:       <xerces-j-user@xml.apache.org>
                                               
                      <katarzyna.m@heli        cc:                                    
                                                
                      osnet.pl>                Subject:  Propagating entity resolvers down
to the schema parser                        
                                                                                         
                                             
                      11/11/2002 09:39                                                   
                                             
                      AM                                                                 
                                             
                      Please respond to                                                  
                                             
                      xerces-j-user                                                      
                                             
                                                                                         
                                             
                                                                                         
                                             



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





---------------------------------------------------------------------
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