XPathMessageFilter.WriteXPathTo(XmlWriter, String, String, String, Boolean) 方法

定義

使用已指定 XML 寫入器寫入 XML XPath 項目。Writes the XML XPath element with a specified XML writer.

public:
 void WriteXPathTo(System::Xml::XmlWriter ^ writer, System::String ^ prefix, System::String ^ localName, System::String ^ ns, bool writeNamespaces);
public void WriteXPathTo (System.Xml.XmlWriter writer, string prefix, string localName, string ns, bool writeNamespaces);
member this.WriteXPathTo : System.Xml.XmlWriter * string * string * string * bool -> unit
Public Sub WriteXPathTo (writer As XmlWriter, prefix As String, localName As String, ns As String, writeNamespaces As Boolean)

參數

writer
XmlWriter

用來寫入 XmlWriterXPathMessageFilterThe XmlWriter used to write the XPathMessageFilter.

prefix
String

XPath XML 項目的命名空間前置詞。The namespace prefix of the XPath XML element.

localName
String

XPath XML 項目的本機名稱。The local name of the XPath XML element.

ns
String

與 XML 項目關聯的命名空間 URI。The namespace URI to associate with the XML element.

writeNamespaces
Boolean

如果應將命名空間另外序列化為屬性,則為 true,否則為 falsetrue if namespaces should be serialized out separately as attributes; otherwise, false.

例外狀況

writerlocalNamenullwriter or localName is null.

localName 的長度 = 0。localName has length = 0.

備註

writer 必須處於啟動狀態。The writer must be in the Start state. 否則,會擲回例外狀況。Otherwise an exception is thrown.

適用於