System.Xml.WriteState Enumeration

Specifies the state of the System.Xml.XmlWriter.

Syntax

public enum WriteState

Remarks

When a writer is instantiated, the write state is set to Start. While content is written, the write state is set to reflect the type of content being written. When the XmlWriter.Close method is called, the write state is set to Closed. The XmlWriter.WriteEndDocument method resets the write state back to Start, allowing the writer to write a new XML document.

Members

Member NameDescription
Attribute

Indicates that an attribute value is being written.

Closed

Indicates that the XmlWriter.Close method has been called.

Content

Indicates that element content is being written.

Element

Indicates that an element start tag is being written.

Error

An exception has been thrown, which has left the System.Xml.XmlWriter in an invalid state. You can call the XmlWriter.Close method to put the System.Xml.XmlWriter in the WriteState.Closed state. Any other System.Xml.XmlWriter method calls results in an InvalidOperationException.

Prolog

Indicates that the prolog is being written.

Start

Indicates that a Write method has not yet been called.

Requirements

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