Mono Class Library: System.Xml.XmlReader Overview | Members

System.Xml.XmlReader.ReadOuterXml Method

Reads the current node and its contents, including child nodes and markup. [Edit]

public virtual string ReadOuterXml ()

Returns

A string containing the XML content, or string.Empty if the current node is neither an element nor attribute. [Edit]

Exceptions

TypeReason
System.Xml.XmlExceptionThe XML was not well-formed, or an error occurred while parsing the XML. [Edit]

Remarks

Operation

The current node and corresponding end node are returned.

If the current node is an element, after the call to this method, the reader is positioned after the corresponding end element.

If the current node is an attribute, the position of the reader is not changed.

Note:

For a comparison between this method and the XmlReader.ReadOuterXml method, see XmlTextReader.ReadInnerXml.

Note to Inheritors
This method must be overridden in order to provide the functionality described above, as there is no default implementation.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0