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.

适用于