本文整理汇总了C#中System.Xml.Schema.XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的具体用法?C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName怎么用?C# XmlSchemaAny.ValidateWildcardAllowsNamespaceName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Schema.XmlSchemaAny
的用法示例。
在下文中一共展示了XmlSchemaAny.ValidateWildcardAllowsNamespaceName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExamineAttributeWildcardIntersection
// 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;
}