XmlWriterSettings.CheckCharacters XmlWriterSettings.CheckCharacters XmlWriterSettings.CheckCharacters XmlWriterSettings.CheckCharacters Property


取得或設定值,這個值表示 XML 寫入器是否應該檢查以確定文件中的所有字元都符合 W3C XML 1.0 Recommendation 中的 "2.2 Characters" 一節。Gets or sets a value that indicates whether the XML writer should check to ensure that all characters in the document conform to the "2.2 Characters" section of the W3C XML 1.0 Recommendation.

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


true 表示執行字元檢查,否則為 falsetrue to do character checking; otherwise, false. 預設為 trueThe default is true.


如果XmlWriter物件支援的字元檢查,它會擲回例外狀況,W3C 的 < 2.2 字元 > 一節所指定的合法 XML 字元範圍以外的任何字元是否XML 1.0 建議事項If the XmlWriter object supports character checking, it throws an exception if any characters are outside the range of legal XML characters specified by the "2.2 Characters" section of the W3C XML 1.0 Recommendation.

字元檢查不包括檢查 XML 名稱中不合法的字元,或檢查所有的 XML 名稱有效。Character checking does not include checking for illegal characters in XML names or checking that all XML names are valid. 這些檢查是一致性檢查的一部分,並且一律會執行。These checks are part of conformance checking and are always performed.