src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java

Print this page




  60 import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
  61 import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
  62 import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
  63 import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig;
  64 import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
  65 import com.sun.org.apache.xerces.internal.impl.xs.util.XSInputSource;
  66 import com.sun.org.apache.xerces.internal.parsers.SAXParser;
  67 import com.sun.org.apache.xerces.internal.parsers.XML11Configuration;
  68 import com.sun.org.apache.xerces.internal.util.DOMInputSource;
  69 import com.sun.org.apache.xerces.internal.util.DOMUtil;
  70 import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
  71 import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
  72 import com.sun.org.apache.xerces.internal.util.SAXInputSource;
  73 import com.sun.org.apache.xerces.internal.util.SecurityManager;
  74 import com.sun.org.apache.xerces.internal.util.StAXInputSource;
  75 import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper;
  76 import com.sun.org.apache.xerces.internal.util.SymbolHash;
  77 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  78 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
  79 import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;

  80 import com.sun.org.apache.xerces.internal.xni.QName;
  81 import com.sun.org.apache.xerces.internal.xni.XNIException;
  82 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
  83 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
  84 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
  85 import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
  86 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
  87 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
  88 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  89 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  90 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  91 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
  92 import com.sun.org.apache.xerces.internal.xs.StringList;
  93 import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
  94 import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
  95 import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
  96 import com.sun.org.apache.xerces.internal.xs.XSConstants;
  97 import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
  98 import com.sun.org.apache.xerces.internal.xs.XSModelGroup;
  99 import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
 100 import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
 101 import com.sun.org.apache.xerces.internal.xs.XSObject;
 102 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 103 import com.sun.org.apache.xerces.internal.xs.XSParticle;
 104 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
 105 import com.sun.org.apache.xerces.internal.xs.XSTerm;
 106 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
 107 import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;

 108 import org.w3c.dom.Document;
 109 import org.w3c.dom.Element;
 110 import org.w3c.dom.Node;
 111 import org.xml.sax.InputSource;
 112 import org.xml.sax.SAXException;
 113 import org.xml.sax.SAXParseException;
 114 import org.xml.sax.XMLReader;
 115 import org.xml.sax.helpers.XMLReaderFactory;
 116 
 117 /**
 118  * The purpose of this class is to co-ordinate the construction of a
 119  * grammar object corresponding to a schema.  To do this, it must be
 120  * prepared to parse several schema documents (for instance if the
 121  * schema document originally referred to contains <include> or
 122  * <redefined> information items).  If any of the schemas imports a
 123  * schema, other grammars may be constructed as a side-effect.
 124  *
 125  * @xerces.internal
 126  *
 127  * @author Neil Graham, IBM


 204 
 205     /** Property identifier: grammar pool. */
 206     public static final String XMLGRAMMAR_POOL =
 207         Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
 208 
 209     /** Property identifier: symbol table. */
 210     public static final String SYMBOL_TABLE =
 211         Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
 212 
 213     /** Property identifier: security manager. */
 214     protected static final String SECURITY_MANAGER =
 215         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 216 
 217     private static final String SECURE_PROCESSING =
 218         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 219 
 220     /** Property identifier: locale. */
 221     protected static final String LOCALE =
 222         Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
 223 






 224     protected static final boolean DEBUG_NODE_POOL = false;
 225 
 226     // Data
 227 
 228     // different sorts of declarations; should make lookup and
 229     // traverser calling more efficient/less bulky.
 230     final static int ATTRIBUTE_TYPE          = 1;
 231     final static int ATTRIBUTEGROUP_TYPE     = 2;
 232     final static int ELEMENT_TYPE            = 3;
 233     final static int GROUP_TYPE              = 4;
 234     final static int IDENTITYCONSTRAINT_TYPE = 5;
 235     final static int NOTATION_TYPE           = 6;
 236     final static int TYPEDECL_TYPE           = 7;
 237 
 238     // this string gets appended to redefined names; it's purpose is to be
 239     // as unlikely as possible to cause collisions.
 240     public final static String REDEF_IDENTIFIER = "_fn3dktizrknc9pi";
 241 
 242     //
 243     //protected data that can be accessable by any traverser
 244 
 245     protected XSDeclarationPool fDeclPool = null;
 246 
 247     /**
 248      * <p>Security manager in effect.</p>
 249      *
 250      * <p>Protected to allow access by any traverser.</p>
 251      */
 252     protected SecurityManager fSecureProcessing = null;
 253 


 254     // These tables correspond to the symbol spaces defined in the
 255     // spec.
 256     // They are keyed with a QName (that is, String("URI,localpart) and
 257     // their values are nodes corresponding to the given name's decl.
 258     // By asking the node for its ownerDocument and looking in
 259     // XSDocumentInfoRegistry we can easily get the corresponding
 260     // XSDocumentInfo object.
 261     private boolean registryEmpty = true;
 262     private Map<String, Element> fUnparsedAttributeRegistry = new HashMap();
 263     private Map<String, Element> fUnparsedAttributeGroupRegistry =  new HashMap();
 264     private Map<String, Element> fUnparsedElementRegistry =  new HashMap();
 265     private Map<String, Element> fUnparsedGroupRegistry =  new HashMap();
 266     private Map<String, Element> fUnparsedIdentityConstraintRegistry =  new HashMap();
 267     private Map<String, Element> fUnparsedNotationRegistry =  new HashMap();
 268     private Map<String, Element> fUnparsedTypeRegistry =  new HashMap();
 269     // Compensation for the above hashtables to locate XSDocumentInfo,
 270     // Since we may take Schema Element directly, so can not get the
 271     // corresponding XSDocumentInfo object just using above hashtables.
 272     private Map<String, XSDocumentInfo> fUnparsedAttributeRegistrySub =  new HashMap();
 273     private Map<String, XSDocumentInfo> fUnparsedAttributeGroupRegistrySub =  new HashMap();


2133             // file not found errors. but schemaHint=="" is perfectly
2134             // legal for import.
2135             if (schemaSource != null &&
2136                     (schemaSource.getSystemId() != null ||
2137                             schemaSource.getByteStream() != null ||
2138                             schemaSource.getCharacterStream() != null)) {
2139 
2140                 // When the system id of the input source is used, first try to
2141                 // expand it, and check whether the same document has been
2142                 // parsed before. If so, return the document corresponding to
2143                 // that system id.
2144                 XSDKey key = null;
2145                 String schemaId = null;
2146                 if (referType != XSDDescription.CONTEXT_PREPARSE){
2147                     schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
2148                     key = new XSDKey(schemaId, referType, schemaNamespace);
2149                     if((schemaElement = (Element)fTraversed.get(key)) != null) {
2150                         fLastSchemaWasDuplicate = true;
2151                         return schemaElement;
2152                     }







2153                 }


2154 
2155                 fSchemaParser.parse(schemaSource);
2156                 Document schemaDocument = fSchemaParser.getDocument();
2157                 schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
2158                 return getSchemaDocument0(key, schemaId, schemaElement);
2159             }
2160             else {
2161                 hasInput = false;
2162             }
2163         }
2164         catch (IOException ex) {
2165             exception = ex;
2166         }
2167         return getSchemaDocument1(mustResolve, hasInput, schemaSource, referElement, exception);
2168     } // getSchemaDocument(String, XMLInputSource, boolean, short, Element): Element
2169 
2170     /**
2171      * getSchemaDocument method uses SAXInputSource to parse a schema document.
2172      * @param schemaNamespace
2173      * @param schemaSource


3544             fGrammarPool =
3545                 (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL);
3546         } catch (XMLConfigurationException e) {
3547             fGrammarPool = null;
3548         }
3549         // security features
3550         try {
3551             if (componentManager.getFeature(DISALLOW_DOCTYPE, false)) {
3552                 fSchemaParser.setFeature(DISALLOW_DOCTYPE, true);
3553             }
3554         } catch (XMLConfigurationException e) {
3555         }
3556         try {
3557             Object security = componentManager.getProperty(SECURITY_MANAGER, null);
3558             if (security != null){
3559                 fSchemaParser.setProperty(SECURITY_MANAGER, security);
3560             }
3561         } catch (XMLConfigurationException e) {
3562         }
3563 





3564     } // reset(XMLComponentManager)
3565 
3566 
3567     /**
3568      * Traverse all the deferred local elements. This method should be called
3569      * by traverseSchemas after we've done with all the global declarations.
3570      */
3571     void traverseLocalElements() {
3572         fElementTraverser.fDeferTraversingLocalElements = false;
3573 
3574         for (int i = 0; i < fLocalElemStackPos; i++) {
3575             Element currElem = fLocalElementDecl[i];
3576             //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getDocument(currElem));
3577             //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getRoot(DOMUtil.getDocument(currElem)));
3578             XSDocumentInfo currSchema = fLocalElementDecl_schema[i];
3579             SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace);
3580             fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]);
3581             // If it's an empty particle, remove it from the containing component.
3582             if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) {
3583                 XSModelGroupImpl group = null;




  60 import com.sun.org.apache.xerces.internal.impl.xs.identity.IdentityConstraint;
  61 import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
  62 import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser;
  63 import com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig;
  64 import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator;
  65 import com.sun.org.apache.xerces.internal.impl.xs.util.XSInputSource;
  66 import com.sun.org.apache.xerces.internal.parsers.SAXParser;
  67 import com.sun.org.apache.xerces.internal.parsers.XML11Configuration;
  68 import com.sun.org.apache.xerces.internal.util.DOMInputSource;
  69 import com.sun.org.apache.xerces.internal.util.DOMUtil;
  70 import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler;
  71 import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper;
  72 import com.sun.org.apache.xerces.internal.util.SAXInputSource;
  73 import com.sun.org.apache.xerces.internal.util.SecurityManager;
  74 import com.sun.org.apache.xerces.internal.util.StAXInputSource;
  75 import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper;
  76 import com.sun.org.apache.xerces.internal.util.SymbolHash;
  77 import com.sun.org.apache.xerces.internal.util.SymbolTable;
  78 import com.sun.org.apache.xerces.internal.util.XMLSymbols;
  79 import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
  80 import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
  81 import com.sun.org.apache.xerces.internal.xni.QName;
  82 import com.sun.org.apache.xerces.internal.xni.XNIException;
  83 import com.sun.org.apache.xerces.internal.xni.grammars.Grammar;
  84 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
  85 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
  86 import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
  87 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
  88 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
  89 import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
  90 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
  91 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
  92 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException;
  93 import com.sun.org.apache.xerces.internal.xs.StringList;
  94 import com.sun.org.apache.xerces.internal.xs.XSAttributeDeclaration;
  95 import com.sun.org.apache.xerces.internal.xs.XSAttributeGroupDefinition;
  96 import com.sun.org.apache.xerces.internal.xs.XSAttributeUse;
  97 import com.sun.org.apache.xerces.internal.xs.XSConstants;
  98 import com.sun.org.apache.xerces.internal.xs.XSElementDeclaration;
  99 import com.sun.org.apache.xerces.internal.xs.XSModelGroup;
 100 import com.sun.org.apache.xerces.internal.xs.XSModelGroupDefinition;
 101 import com.sun.org.apache.xerces.internal.xs.XSNamedMap;
 102 import com.sun.org.apache.xerces.internal.xs.XSObject;
 103 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
 104 import com.sun.org.apache.xerces.internal.xs.XSParticle;
 105 import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
 106 import com.sun.org.apache.xerces.internal.xs.XSTerm;
 107 import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
 108 import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
 109 import javax.xml.XMLConstants;
 110 import org.w3c.dom.Document;
 111 import org.w3c.dom.Element;
 112 import org.w3c.dom.Node;
 113 import org.xml.sax.InputSource;
 114 import org.xml.sax.SAXException;
 115 import org.xml.sax.SAXParseException;
 116 import org.xml.sax.XMLReader;
 117 import org.xml.sax.helpers.XMLReaderFactory;
 118 
 119 /**
 120  * The purpose of this class is to co-ordinate the construction of a
 121  * grammar object corresponding to a schema.  To do this, it must be
 122  * prepared to parse several schema documents (for instance if the
 123  * schema document originally referred to contains <include> or
 124  * <redefined> information items).  If any of the schemas imports a
 125  * schema, other grammars may be constructed as a side-effect.
 126  *
 127  * @xerces.internal
 128  *
 129  * @author Neil Graham, IBM


 206 
 207     /** Property identifier: grammar pool. */
 208     public static final String XMLGRAMMAR_POOL =
 209         Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
 210 
 211     /** Property identifier: symbol table. */
 212     public static final String SYMBOL_TABLE =
 213         Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
 214 
 215     /** Property identifier: security manager. */
 216     protected static final String SECURITY_MANAGER =
 217         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 218 
 219     private static final String SECURE_PROCESSING =
 220         Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
 221 
 222     /** Property identifier: locale. */
 223     protected static final String LOCALE =
 224         Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
 225 
 226     /** property identifier: access external dtd. */
 227     public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD;
 228 
 229     /** Property identifier: access to external schema */
 230     public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA;
 231 
 232     protected static final boolean DEBUG_NODE_POOL = false;
 233 
 234     // Data
 235 
 236     // different sorts of declarations; should make lookup and
 237     // traverser calling more efficient/less bulky.
 238     final static int ATTRIBUTE_TYPE          = 1;
 239     final static int ATTRIBUTEGROUP_TYPE     = 2;
 240     final static int ELEMENT_TYPE            = 3;
 241     final static int GROUP_TYPE              = 4;
 242     final static int IDENTITYCONSTRAINT_TYPE = 5;
 243     final static int NOTATION_TYPE           = 6;
 244     final static int TYPEDECL_TYPE           = 7;
 245 
 246     // this string gets appended to redefined names; it's purpose is to be
 247     // as unlikely as possible to cause collisions.
 248     public final static String REDEF_IDENTIFIER = "_fn3dktizrknc9pi";
 249 
 250     //
 251     //protected data that can be accessable by any traverser
 252 
 253     protected XSDeclarationPool fDeclPool = null;
 254 
 255     /**
 256      * <p>Security manager in effect.</p>
 257      *
 258      * <p>Protected to allow access by any traverser.</p>
 259      */
 260     protected SecurityManager fSecureProcessing = null;
 261 
 262     private String fAccessExternalSchema;
 263 
 264     // These tables correspond to the symbol spaces defined in the
 265     // spec.
 266     // They are keyed with a QName (that is, String("URI,localpart) and
 267     // their values are nodes corresponding to the given name's decl.
 268     // By asking the node for its ownerDocument and looking in
 269     // XSDocumentInfoRegistry we can easily get the corresponding
 270     // XSDocumentInfo object.
 271     private boolean registryEmpty = true;
 272     private Map<String, Element> fUnparsedAttributeRegistry = new HashMap();
 273     private Map<String, Element> fUnparsedAttributeGroupRegistry =  new HashMap();
 274     private Map<String, Element> fUnparsedElementRegistry =  new HashMap();
 275     private Map<String, Element> fUnparsedGroupRegistry =  new HashMap();
 276     private Map<String, Element> fUnparsedIdentityConstraintRegistry =  new HashMap();
 277     private Map<String, Element> fUnparsedNotationRegistry =  new HashMap();
 278     private Map<String, Element> fUnparsedTypeRegistry =  new HashMap();
 279     // Compensation for the above hashtables to locate XSDocumentInfo,
 280     // Since we may take Schema Element directly, so can not get the
 281     // corresponding XSDocumentInfo object just using above hashtables.
 282     private Map<String, XSDocumentInfo> fUnparsedAttributeRegistrySub =  new HashMap();
 283     private Map<String, XSDocumentInfo> fUnparsedAttributeGroupRegistrySub =  new HashMap();


2143             // file not found errors. but schemaHint=="" is perfectly
2144             // legal for import.
2145             if (schemaSource != null &&
2146                     (schemaSource.getSystemId() != null ||
2147                             schemaSource.getByteStream() != null ||
2148                             schemaSource.getCharacterStream() != null)) {
2149 
2150                 // When the system id of the input source is used, first try to
2151                 // expand it, and check whether the same document has been
2152                 // parsed before. If so, return the document corresponding to
2153                 // that system id.
2154                 XSDKey key = null;
2155                 String schemaId = null;
2156                 if (referType != XSDDescription.CONTEXT_PREPARSE){
2157                     schemaId = XMLEntityManager.expandSystemId(schemaSource.getSystemId(), schemaSource.getBaseSystemId(), false);
2158                     key = new XSDKey(schemaId, referType, schemaNamespace);
2159                     if((schemaElement = (Element)fTraversed.get(key)) != null) {
2160                         fLastSchemaWasDuplicate = true;
2161                         return schemaElement;
2162                     }
2163                     if (referType == XSDDescription.CONTEXT_IMPORT || referType == XSDDescription.CONTEXT_INCLUDE
2164                             || referType == XSDDescription.CONTEXT_REDEFINE) {
2165                         String accessError = SecuritySupport.checkAccess(schemaId, fAccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL);
2166                         if (accessError != null) {
2167                             reportSchemaFatalError("schema_reference.access",
2168                                     new Object[] { SecuritySupport.sanitizePath(schemaId), accessError },
2169                                     referElement);
2170                         }
2171                     }
2172                 }
2173 
2174                 fSchemaParser.parse(schemaSource);
2175                 Document schemaDocument = fSchemaParser.getDocument();
2176                 schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null;
2177                 return getSchemaDocument0(key, schemaId, schemaElement);
2178             }
2179             else {
2180                 hasInput = false;
2181             }
2182         }
2183         catch (IOException ex) {
2184             exception = ex;
2185         }
2186         return getSchemaDocument1(mustResolve, hasInput, schemaSource, referElement, exception);
2187     } // getSchemaDocument(String, XMLInputSource, boolean, short, Element): Element
2188 
2189     /**
2190      * getSchemaDocument method uses SAXInputSource to parse a schema document.
2191      * @param schemaNamespace
2192      * @param schemaSource


3563             fGrammarPool =
3564                 (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL);
3565         } catch (XMLConfigurationException e) {
3566             fGrammarPool = null;
3567         }
3568         // security features
3569         try {
3570             if (componentManager.getFeature(DISALLOW_DOCTYPE, false)) {
3571                 fSchemaParser.setFeature(DISALLOW_DOCTYPE, true);
3572             }
3573         } catch (XMLConfigurationException e) {
3574         }
3575         try {
3576             Object security = componentManager.getProperty(SECURITY_MANAGER, null);
3577             if (security != null){
3578                 fSchemaParser.setProperty(SECURITY_MANAGER, security);
3579             }
3580         } catch (XMLConfigurationException e) {
3581         }
3582 
3583         //For Schema validation, the secure feature is set to true by default
3584         fSchemaParser.setProperty(ACCESS_EXTERNAL_DTD, 
3585                 componentManager.getProperty(ACCESS_EXTERNAL_DTD, Constants.EXTERNAL_ACCESS_DEFAULT));
3586         fAccessExternalSchema = (String) componentManager.getProperty(
3587                 ACCESS_EXTERNAL_SCHEMA, Constants.EXTERNAL_ACCESS_DEFAULT);
3588     } // reset(XMLComponentManager)
3589 
3590 
3591     /**
3592      * Traverse all the deferred local elements. This method should be called
3593      * by traverseSchemas after we've done with all the global declarations.
3594      */
3595     void traverseLocalElements() {
3596         fElementTraverser.fDeferTraversingLocalElements = false;
3597 
3598         for (int i = 0; i < fLocalElemStackPos; i++) {
3599             Element currElem = fLocalElementDecl[i];
3600             //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getDocument(currElem));
3601             //XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getRoot(DOMUtil.getDocument(currElem)));
3602             XSDocumentInfo currSchema = fLocalElementDecl_schema[i];
3603             SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace);
3604             fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]);
3605             // If it's an empty particle, remove it from the containing component.
3606             if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) {
3607                 XSModelGroupImpl group = null;