private void addNewGrammarComponents(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) { dstGrammar.resetComponents(); addGlobalElementDecls(srcGrammar, dstGrammar); addGlobalAttributeDecls(srcGrammar, dstGrammar); addGlobalAttributeGroupDecls(srcGrammar, dstGrammar); addGlobalGroupDecls(srcGrammar, dstGrammar); addGlobalTypeDecls(srcGrammar, dstGrammar); addGlobalNotationDecls(srcGrammar, dstGrammar); }
private void addGlobalComponents(Vector components, Hashtable importDependencies) { final XSDDescription desc = new XSDDescription(); final int size = components.size(); for (int i=0; i<size; i++) { addGlobalComponent((XSObject) components.elementAt(i), desc); } updateImportDependencies(importDependencies); }
Vector expandedGrammars = expandGrammars(grammars); if (fNamespaceGrowth || !existingGrammars(expandedGrammars)) { addGrammars(expandedGrammars); if (referType == XSDDescription.CONTEXT_PREPARSE) { desc.setTargetNamespace(grammars[0].getTargetNamespace()); if (components != null && components.length > 0) { Hashtable importDependencies = new Hashtable(); Vector expandedComponents = expandComponents(components, importDependencies); if (fNamespaceGrowth || canAddComponents(expandedComponents)) { addGlobalComponents(expandedComponents, importDependencies); if (referType == XSDDescription.CONTEXT_PREPARSE) { desc.setTargetNamespace(components[0].getNamespace());
XSElementDecl globalDecl = (XSElementDecl)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.ELEMENT_TYPE, subGroup, elmDecl); if (globalDecl != null) { elemDecl.add(globalDecl); elementType = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, typeAtt, elmDecl); if (elementType == null) { element.fUnresolvedTypeName = typeAtt; fSchemaHandler.storeIdentityConstraintReferral(child, schemaDoc, element); fSchemaHandler.fUniqueOrKeyTraverser.traverse(child, element, schemaDoc, grammar); if(DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME).length() != 0 ) { fSchemaHandler.checkForDuplicateNames( (schemaDoc.fTargetNamespace == null) ? ","+DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME) : schemaDoc.fTargetNamespace+","+ DOMUtil.getAttrValue(child, SchemaSymbols.ATT_NAME), XSDHandler.ATTRIBUTE_TYPE, fSchemaHandler.getIDRegistry(), fSchemaHandler.getIDRegistry_sub(), child, schemaDoc); fSchemaHandler.storeKeyRef(child, schemaDoc, element); final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc); final XSElementDecl element2 = grammar.getGlobalElementDecl(element.fName, loc); if (element2 == null) { element = element2; fSchemaHandler.addGlobalElementDecl(element);
final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc); final XSGroupDecl group2 = grammar.getGlobalGroupDecl(group.fName, loc); if (group2 == null) { group = group2; fSchemaHandler.addGlobalGroupDecl(group); Object redefinedGrp = fSchemaHandler.getGrpOrAttrGrpRedefinedByRestriction(XSDHandler.GROUP_TYPE, new QName(XMLSymbols.EMPTY_STRING, strNameAttr, strNameAttr, schemaDoc.fTargetNamespace), schemaDoc, elmNode); fSchemaHandler.element2Locator(elmNode));
XSAttributeGroupDecl redefinedAttrGrp = (XSAttributeGroupDecl)fSchemaHandler.getGrpOrAttrGrpRedefinedByRestriction( XSDHandler.ATTRIBUTEGROUP_TYPE, new QName(XMLSymbols.EMPTY_STRING, nameAttr, nameAttr, schemaDoc.fTargetNamespace), final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc); final XSAttributeGroupDecl attrGrp2 = grammar.getGlobalAttributeGroupDecl(attrGrp.fName, loc); if (attrGrp2 == null) { attrGrp = attrGrp2; fSchemaHandler.addGlobalAttributeGroupDecl(attrGrp);
XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, typeAtt, attrDecl); if (type != null && type.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) { attrType = (XSSimpleType)type; final String loc = fSchemaHandler.schemaDocument2SystemId(schemaDoc); final XSAttributeDecl attribute2 = grammar.getGlobalAttributeDecl(nameAtt, loc); if (attribute2 == null) { attribute = attribute2; fSchemaHandler.addGlobalAttributeDecl(attribute);
fSchemaHandler = new XSDHandler(fGrammarBucket, fSchemaVersion, fXSConstraints); fJAXPCache = new WeakHashMap();