共用方式為


XPathMessageFilter.WriteXPathTo 方法

定義

使用已指定 XML 寫入器寫入 XML XPath 項目。

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

用來寫入 XmlWriterXPathMessageFilter

prefix
String

XPath XML 項目的命名空間前置詞。

localName
String

XPath XML 項目的本機名稱。

ns
String

與 XML 項目關聯的命名空間 URI。

writeNamespaces
Boolean

如果應將命名空間另外序列化為屬性,則為 true,否則為 false

例外狀況

writerlocalNamenull

localName 的長度 = 0。

備註

writer必須處於 啟動 狀態。 否則,會擲回例外狀況。

適用於