internal bool ValidateWildcardSubset (XsdWildcard other,
ValidationEventHandler h, XmlSchema schema, bool raiseError)
{
// 1.
if (other.HasValueAny)
return true;
// 2.
if (HasValueOther && other.HasValueOther) {
// 2.1 and 2.2
if (TargetNamespace == other.TargetNamespace ||
other.TargetNamespace == null || other.TargetNamespace == "")
return true;
}
// 3.1. (not)
if (this.HasValueAny) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
}
// 3.2
if (other.HasValueOther) {
// 3.2.2
if ( (this.HasValueTargetNamespace && other.TargetNamespace == this.TargetNamespace) ||
(this.HasValueLocal && (other.TargetNamespace == null || other.TargetNamespace.Length == 0)) ) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
} else {
for (int i = 0; i < ResolvedNamespaces.Count; i++) {
if (ResolvedNamespaces [i] == other.TargetNamespace) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
}
}
}
} else {
// 3.2.1
if ((this.HasValueLocal && !other.HasValueLocal) ||
this.HasValueTargetNamespace && !other.HasValueTargetNamespace) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
} else if (this.HasValueOther) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
} else {
for (int i = 0; i < this.ResolvedNamespaces.Count; i++)
if (!other.ResolvedNamespaces.Contains (this.ResolvedNamespaces [i])) {
if (raiseError)
xsobj.error (h, "Invalid wildcard subset was found.");
return false;
}
}
}
return true;
}
}