// 3.8.6. Attribute Wildcard Intersection
        // Only try to examine if their intersection is expressible, and
        // returns true if the result is empty.
        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);
        }
Example #2
0
 public bool ExamineAttributeWildcardIntersection(XmlSchemaAny other, ValidationEventHandler h, XmlSchema schema)
 {
     if (this.HasValueAny == other.HasValueAny && this.HasValueLocal == other.HasValueLocal && this.HasValueOther == other.HasValueOther && this.HasValueTargetNamespace == other.HasValueTargetNamespace && this.ResolvedProcessing == other.ResolvedProcessContents)
     {
         bool flag = false;
         for (int i = 0; i < this.ResolvedNamespaces.Count; i++)
         {
             if (!other.ResolvedNamespaces.Contains(this.ResolvedNamespaces[i]))
             {
                 flag = true;
             }
         }
         if (!flag)
         {
             return(false);
         }
     }
     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);
     }
     if (this.HasValueOther && other.HasValueOther && this.TargetNamespace != other.TargetNamespace)
     {
         return(false);
     }
     if (this.HasValueOther)
     {
         return((!other.HasValueLocal || !(this.TargetNamespace != string.Empty)) && (!other.HasValueTargetNamespace || !(this.TargetNamespace != other.TargetNamespace)) && other.ValidateWildcardAllowsNamespaceName(this.TargetNamespace, h, schema, false));
     }
     if (other.HasValueOther)
     {
         return((!this.HasValueLocal || !(other.TargetNamespace != string.Empty)) && (!this.HasValueTargetNamespace || !(other.TargetNamespace != this.TargetNamespace)) && this.ValidateWildcardAllowsNamespaceName(other.TargetNamespace, h, schema, false));
     }
     if (this.ResolvedNamespaces.Count > 0)
     {
         for (int j = 0; j < this.ResolvedNamespaces.Count; j++)
         {
             if (other.ResolvedNamespaces.Contains(this.ResolvedNamespaces[j]))
             {
                 return(false);
             }
         }
     }
     return(true);
 }