Share via


XmlSerializationWriter.WriteElementLiteral 方法

定義

指示 XmlWriter 物件在具名 XML 項目的主體內寫入 XmlNode 物件。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

protected:
 void WriteElementLiteral(System::Xml::XmlNode ^ node, System::String ^ name, System::String ^ ns, bool isNullable, bool any);
protected void WriteElementLiteral (System.Xml.XmlNode? node, string name, string? ns, bool isNullable, bool any);
protected void WriteElementLiteral (System.Xml.XmlNode node, string name, string ns, bool isNullable, bool any);
member this.WriteElementLiteral : System.Xml.XmlNode * string * string * bool * bool -> unit
Protected Sub WriteElementLiteral (node As XmlNode, name As String, ns As String, isNullable As Boolean, any As Boolean)

參數

node
XmlNode

要寫入的 XML 節點,可能是子 XML 項目。

name
String

要寫入之父 XML 項目的區域名稱。

ns
String

要寫入之父 XML 項目的命名空間。

isNullable
Boolean

如果要序列化的物件是 true,則 xsi:nil='true' 表示要寫入 null 屬性,否則為 false

any
Boolean

true 表示節點 (如果是 XML 項目的話) 符合 XML 結構描述 any 項目宣告,否則為 false

備註

的受保護成員 XmlSerializationWriter 僅供在 .NET Framework XML 序列化基礎結構內部使用的衍生類別使用。

WriteElementLiteral只有在撰寫可在 XML 架構檔中定義的常值 XML 時,才會呼叫 方法。

適用於