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.


如果物件支援字元檢查, 則如果有任何字元超出 W3C xml 1.0 建議的 "2.2 字元" 區段所指定的合法 xml 字元範圍, 就會擲回例外狀況。 XmlWriterIf 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.