System.Xml.XmlWriter.WriteNode Method

Copies everything from the System.Xml.XPath.XPathNavigator object to the writer. The position of the System.Xml.XPath.XPathNavigator remains unchanged.

Syntax

public virtual void WriteNode (System.Xml.XPath.XPathNavigator navigator, bool defattr)

Parameters

navigator
The System.Xml.XPath.XPathNavigator to copy from.
defattr
true to copy the default attributes; otherwise, false.

Remarks

The following table shows the supported XPath node types for this method.

Root

Writes out all the nodes irrespective of type. That is, the writer consumes the System.Xml.XPath.XPathNavigator and writes out all the nodes from the root node (including attributes, processing instructions, comments and so on.)

Element

Writes out the element node and any attribute nodes.

Attribute

No operation. Use XmlWriter.WriteStartAttribute(string, string) or XmlWriter.WriteAttributeString(string, string, string) instead.

Text

Writes out the text node.

Namespace

No operation. Use the XmlWriter.WriteStartAttribute(string, string) or XmlWriter.WriteAttributeString(string, string, string) method to write the namespace declaration.

ProcessingInstruction

Writes out the processing instruction node.

Comment

Writes out the comment node.

SignificantWhitespace

Writes out the significant white space node.

Whitespace

Writes out the white space node.

For the asynchronous version of this method, see XmlWriter.WriteNodeAsync(System.Xml.XPath.XPathNavigator, bool).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0