Beispiel #1
0
		// 3.10.6 Wildcard Subset
		// Other = wider. this = restricted subset
		internal void ValidateWildcardSubset (XsdWildcard other,
			ValidationEventHandler h, XmlSchema schema)
		{
			ValidateWildcardSubset (other, h, schema, true);
		}
Beispiel #2
0
		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;
		}
 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);
 }
 // 3.10.6 Wildcard Subset
 // Other = wider. this = restricted subset
 internal void ValidateWildcardSubset(XsdWildcard other,
                                      ValidationEventHandler h, XmlSchema schema)
 {
     ValidateWildcardSubset(other, h, schema, true);
 }
Beispiel #5
0
		public XmlSchemaAnyAttribute()
		{
			wildcard = new XsdWildcard (this);
		}
Beispiel #6
0
 internal bool ValidateWildcardSubset(XsdWildcard other, ValidationEventHandler h, XmlSchema schema, bool raiseError)
 {
     if (other.HasValueAny)
     {
         return(true);
     }
     if (this.HasValueOther && other.HasValueOther && (this.TargetNamespace == other.TargetNamespace || other.TargetNamespace == null || other.TargetNamespace == string.Empty))
     {
         return(true);
     }
     if (this.HasValueAny)
     {
         if (raiseError)
         {
             this.xsobj.error(h, "Invalid wildcard subset was found.");
         }
         return(false);
     }
     if (other.HasValueOther)
     {
         if ((this.HasValueTargetNamespace && other.TargetNamespace == this.TargetNamespace) || (this.HasValueLocal && (other.TargetNamespace == null || other.TargetNamespace.Length == 0)))
         {
             if (raiseError)
             {
                 this.xsobj.error(h, "Invalid wildcard subset was found.");
             }
             return(false);
         }
         for (int i = 0; i < this.ResolvedNamespaces.Count; i++)
         {
             if (this.ResolvedNamespaces[i] == other.TargetNamespace)
             {
                 if (raiseError)
                 {
                     this.xsobj.error(h, "Invalid wildcard subset was found.");
                 }
                 return(false);
             }
         }
     }
     else
     {
         if ((this.HasValueLocal && !other.HasValueLocal) || (this.HasValueTargetNamespace && !other.HasValueTargetNamespace))
         {
             if (raiseError)
             {
                 this.xsobj.error(h, "Invalid wildcard subset was found.");
             }
             return(false);
         }
         if (this.HasValueOther)
         {
             if (raiseError)
             {
                 this.xsobj.error(h, "Invalid wildcard subset was found.");
             }
             return(false);
         }
         for (int j = 0; j < this.ResolvedNamespaces.Count; j++)
         {
             if (!other.ResolvedNamespaces.Contains(this.ResolvedNamespaces[j]))
             {
                 if (raiseError)
                 {
                     this.xsobj.error(h, "Invalid wildcard subset was found.");
                 }
                 return(false);
             }
         }
     }
     return(true);
 }
		public XmlSchemaAny()
		{
			wildcard = new XsdWildcard (this);
		}