fGrammarDescription = new XSDDescription();
fGrammarDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
fGrammarDescription.setNamespace(SchemaSymbols.URI_SCHEMAFORSCHEMA);
// no global decls other than types
fGlobalAttrDecls = new SymbolHash(1);
fGlobalAttrGrpDecls = new SymbolHash(1);
fGlobalElemDecls = new SymbolHash(1);
fGlobalGroupDecls = new SymbolHash(1);
fGlobalNotationDecls = new SymbolHash(1);
fGlobalIDConstraintDecls = new SymbolHash(1);
// no extended global decls
fGlobalAttrDeclsExt = new SymbolHash(1);
fGlobalAttrGrpDeclsExt = new SymbolHash(1);
fGlobalElemDeclsExt = new SymbolHash(1);
fGlobalGroupDeclsExt = new SymbolHash(1);
fGlobalNotationDeclsExt = new SymbolHash(1);
fGlobalIDConstraintDeclsExt = new SymbolHash(1);
fGlobalTypeDeclsExt = new SymbolHash(1);
// all global element decls table
fAllGlobalElemDecls = new SymbolHash(1);
// get all built-in types
fGlobalTypeDecls = schemaFactory.getBuiltInTypes();
// assign the built-in schema grammar as the XSNamespaceItem
// for each of the built-in simple type definitions.
int length = fGlobalTypeDecls.getLength();
XSTypeDefinition [] typeDefinitions = new XSTypeDefinition[length];
fGlobalTypeDecls.getValues(typeDefinitions, 0);
for (int i = 0; i < length; ++i) {
XSTypeDefinition xtd = typeDefinitions[i];
if (xtd instanceof XSSimpleTypeDecl) {
((XSSimpleTypeDecl) xtd).setNamespaceItem(this);
}
}
// add anyType
fGlobalTypeDecls.put(fAnyType.getName(), fAnyType);
}
else if (grammar == GRAMMAR_XSI) {
// target namespace
fTargetNamespace = SchemaSymbols.URI_XSI;
// grammar description
fGrammarDescription = new XSDDescription();
fGrammarDescription.fContextType = XSDDescription.CONTEXT_PREPARSE;
fGrammarDescription.setNamespace(SchemaSymbols.URI_XSI);
// no global decls other than attributes
fGlobalAttrGrpDecls = new SymbolHash(1);
fGlobalElemDecls = new SymbolHash(1);
fGlobalGroupDecls = new SymbolHash(1);
fGlobalNotationDecls = new SymbolHash(1);
fGlobalIDConstraintDecls = new SymbolHash(1);
fGlobalTypeDecls = new SymbolHash(1);
// no extended global decls
fGlobalAttrDeclsExt = new SymbolHash(1);
fGlobalAttrGrpDeclsExt = new SymbolHash(1);
fGlobalElemDeclsExt = new SymbolHash(1);
fGlobalGroupDeclsExt = new SymbolHash(1);
fGlobalNotationDeclsExt = new SymbolHash(1);
fGlobalIDConstraintDeclsExt = new SymbolHash(1);
fGlobalTypeDeclsExt = new SymbolHash(1);
// no all global element decls
fAllGlobalElemDecls = new SymbolHash(1);
// 4 attributes, so initialize the size as 4*2 = 8
fGlobalAttrDecls = new SymbolHash(8);
String name = null;
String tns = null;
XSSimpleType type = null;
short scope = XSConstants.SCOPE_GLOBAL;