Thx for pointing it out. Fixed in CVS now.

Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                                                       
                      "Katarzyna                                                
                                                       
                      Marszalek"               To:       <[EMAIL PROTECTED]>    
                                            
                      <[EMAIL PROTECTED]        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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to