String nsText;
if (nsList == null)
nsText = "##any";
else
nsText = nsList.getStringValue();
QNameSet wcset = QNameSet.forWildcardNamespaceString(nsText, targetNamespace);
if (baseModel != null && !extension)
{
if (baseModel.getWildcardSet() == null)
{
state.error("A restriction cannot add anyAttribute when the base type does not have anyAttribute", XmlErrorContext.DUPLICATE_ANY_ATTRIBUTE, xsdwc);
continue; // ignore the extra wildcard
}
else if (!baseModel.getWildcardSet().containsAll(wcset))
{
state.error("The anyAttribute namespace='" + nsText + "' is not a subset of the base type anyAttribute", XmlErrorContext.DUPLICATE_ANY_ATTRIBUTE, xsdwc);
continue; // ignore the restriction
}
}
int wcprocess = translateWildcardProcess(xsdwc.xgetProcessContents());
if (result.getWildcardProcess() == SchemaAttributeModel.NONE)
{
result.setWildcardSet(wcset);
result.setWildcardProcess(wcprocess);
}
else
{
if (extension)
{
result.setWildcardSet(wcset.union(result.getWildcardSet()));
result.setWildcardProcess(wcprocess);
}
else
{
result.setWildcardSet(wcset.intersect(result.getWildcardSet()));
// keep old process
}
}
break;
}