//-- add all attributes from type2
enumeration = cType2.getAttributeDecls();
while (enumeration.hasMoreElements()) {
//-- check for attribute with same name
AttributeDecl attNew = (AttributeDecl)enumeration.nextElement();
String attName = attNew.getName();
AttributeDecl attPrev = cType1.getAttributeDecl(attName);
if (attPrev == null) {
attNew.setUse(AttributeDecl.USE_OPTIONAL);
cType1.addAttributeDecl(attNew);
}
else {
String type1 = attPrev.getSimpleType().getName();
String type2 = attNew.getSimpleType().getName();
if (!type1.equals(type2)) {
String typeName = _nsPrefix + ':' +
DatatypeHandler.whichType(type1, type2);
attPrev.setSimpleTypeReference(typeName); }
}
}
//-- loop through all element/attribute declarations
//-- of e1 and if they do not exist in e2, simply