XmlSchemaCompilationSettings.EnableUpaCheck 屬性

定義

取得或設定值,指出 XmlSchemaSet 是否應該檢查 Unique Particle Attribution (UPA) 違規。

public:
 property bool EnableUpaCheck { bool get(); void set(bool value); };
public bool EnableUpaCheck { get; set; }
member this.EnableUpaCheck : bool with get, set
Public Property EnableUpaCheck As Boolean

屬性值

Boolean

如果 XmlSchemaSet 應該檢查 Unique Particle Attribution (UPA) 違規,則為 true,否則為 false。 預設為 true

備註

EnableUpaCheck當 屬性設定 false 為 時,將會根據下列規則執行驗證。

  1. 如果強型別與萬用字元之間有選擇,將會 XmlSchemaSet 挑選強型別的物件,如下列架構和 Xml 範例所示。

<xs:sequence>

<xs:any namespace="##any"/>

<xs:element name="A" type="xs:string" minOccurs="0"/>

</xs:sequence>

在下列 Xml 中 A ,專案將會與 架構中產生關聯 <xs:element name="A" type="xs:string" minOccurs="0"/>

<A>some text</A>

  1. 如果兩個強型別元素之間有選擇,則會 XmlSchemaSet 挑選第一個元素。

<xs:sequence>

<xs:element name="A" type="xs:string"/>

<xs:element name="B" type="xs:string" minOccurs="0"/>

<xs:element name="B" type="xs:string"/>

</xs:sequence>

在下列 Xml 中 B ,專案將會與 架構中產生關聯 <xs:element name="B" type="xs:string" minOccurs="0"/>

<A/>

<B/>

適用於