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

System.Xml.XmlTextWriter.WriteEndDocument Method

Closes open elements and attributes and sets the XmlTextWriter.WriteState back to the WriteState.Start state.

public override void WriteEndDocument ()

Exceptions

TypeReason
ArgumentExceptionThe current instance is in the wrong System.Xml.WriteState, or the document does not have a root element.
InvalidOperationExceptionThe current instance is in the wrong System.Xml.WriteState, or the document does not have a root element.

Remarks

This method closes all elements and attributes created by the XmlTextWriter.WriteStartElement(string, string, string) and XmlTextWriter.WriteStartAttribute(string, string, string) methods, respectively, that are open when the XmlTextWriter.WriteEndDocument method is called.

Note:

After calling this method, the current instance can be used to write a new XML document.

This method overrides XmlWriter.WriteEndDocument.

Requirements

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