public bool ExamineAttributeWildcardIntersection (XmlSchemaAny other,
ValidationEventHandler h, XmlSchema schema)
{
// 1.
if (this.HasValueAny == other.HasValueAny &&
this.HasValueLocal == other.HasValueLocal &&
this.HasValueOther == other.HasValueOther &&
this.HasValueTargetNamespace == other.HasValueTargetNamespace &&
this.ResolvedProcessing == other.ResolvedProcessContents) {
bool notEqual = false;
for (int i = 0; i < this.ResolvedNamespaces.Count; i++) {
if (!other.ResolvedNamespaces.Contains (this.ResolvedNamespaces [i]))
notEqual = true;
}
if (!notEqual)
return false;
}
// 2.
if (this.HasValueAny)
return !other.HasValueAny &&
!other.HasValueLocal &&
!other.HasValueOther &&
!other.HasValueTargetNamespace &&
other.ResolvedNamespaces.Count == 0;
if (other.HasValueAny)
return !this.HasValueAny &&
!this.HasValueLocal &&
!this.HasValueOther &&
!this.HasValueTargetNamespace &&
this.ResolvedNamespaces.Count == 0;
// 5.
if (this.HasValueOther && other.HasValueOther && this.TargetNamespace != other.TargetNamespace) {
// xsobj.error (h, "The Wildcard intersection is not expressible.");
return false;
}
// 3.
if (this.HasValueOther) {
if (other.HasValueLocal && this.TargetNamespace != String.Empty)
return false;
if (other.HasValueTargetNamespace && this.TargetNamespace != other.TargetNamespace)
return false;
return other.ValidateWildcardAllowsNamespaceName (this.TargetNamespace, h, schema, false);
}
if (other.HasValueOther) {
if (this.HasValueLocal && other.TargetNamespace != String.Empty)
return false;
if (this.HasValueTargetNamespace && other.TargetNamespace != this.TargetNamespace)
return false;
return this.ValidateWildcardAllowsNamespaceName (other.TargetNamespace, h, schema, false);
}
// 4.
if (this.ResolvedNamespaces.Count > 0) {
for (int i = 0; i < this.ResolvedNamespaces.Count; i++)
if (other.ResolvedNamespaces.Contains (this.ResolvedNamespaces [i]))
return false;
}
return true;
}