-1, simpleTypeValidator);
typeInfo.attlistHead = fSchemaGrammar.getFirstAttributeDeclIndex(typeInfo.templateElementIndex);
// (attribute | attrGroupRef)*
XMLAttributeDecl attWildcard = null;
Vector anyAttDecls = new Vector();
for (child = XUtil.getFirstChildElement(complexTypeDecl);
child != null;
child = XUtil.getNextSiblingElement(child)) {
String childName = child.getNodeName();
if (childName.equals(SchemaSymbols.ELT_ATTRIBUTE)) {
if ((baseIsComplexSimple||baseIsSimpleSimple) && derivedByRestriction) {
// REVISIT: Localize
reportGenericSchemaError("In complexType "+typeName+
", base type has simpleType "+
"content and derivation method is"+
" 'restriction', can't have any "+
"attribute children at all");
break;
}
traverseAttributeDecl(child, typeInfo);
}
else if ( childName.equals(SchemaSymbols.ELT_ATTRIBUTEGROUP) ) {
if ((baseIsComplexSimple||baseIsSimpleSimple) && derivedByRestriction) {
// REVISIT: Localize
reportGenericSchemaError("In complexType "+typeName+", base "+
"type has simpleType content and "+
"derivation method is 'restriction',"+
" can't have any attribute children at all");
break;
}
traverseAttributeGroupDecl(child,typeInfo,anyAttDecls);
}
else if ( childName.equals(SchemaSymbols.ELT_ANYATTRIBUTE) ) {
attWildcard = traverseAnyAttribute(child);
}
}
if (attWildcard != null) {
XMLAttributeDecl fromGroup = null;
final int count = anyAttDecls.size();
if ( count > 0) {
fromGroup = (XMLAttributeDecl) anyAttDecls.elementAt(0);
for (int i=1; i<count; i++) {
fromGroup = mergeTwoAnyAttribute(fromGroup,(XMLAttributeDecl)anyAttDecls.elementAt(i));
}
}
if (fromGroup != null) {
int saveProcessContents = attWildcard.defaultType;
attWildcard = mergeTwoAnyAttribute(attWildcard, fromGroup);
attWildcard.defaultType = saveProcessContents;
}
}
else {
//REVISIT: unclear in the Scheme Structures 4.3.3 what to do in this case
}
// merge in base type's attribute decls
XMLAttributeDecl baseAttWildcard = null;
if (baseTypeInfo != null && baseTypeInfo.attlistHead > -1 ) {
int attDefIndex = baseTypeInfo.attlistHead;
while ( attDefIndex > -1 ) {
fTempAttributeDecl.clear();
fSchemaGrammar.getAttributeDecl(attDefIndex, fTempAttributeDecl);