Share via


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必须处于“开始”状态。 否则会引发异常。

适用于