Properties of the Xml Writer Class

Get Paid To Write Online

Get Paid to Write at Home

Get Instant Access

Table 4-1 lists the properties that belong to the XmlWriter class.

Table 4-1: Properties of the XmlWriter Class




Read-only property that gets the state of the writer. The state can be any value taken from the WriteState enumeration and describes the element being written.


Read-only property that returns the current xml:lang scope. You set the language of the document by writing an xml:lang attribute to the output stream.


Read-only property that indicates the current xml:space scope through a value taken from the XmlSpace enumeration (Default, None, or Preserve).

All of these properties are read-only and abstract—that is, they must be overridden in any derived class. The behavior described in Table 4-1 simply indicates what the properties have been designed for and does not necessarily reflect the actual behavior of these properties in a custom implementation.

In general, the XmlWriter class properties serve to track the state in which another component might have left the writer. Note that these properties belong to the current instance of the writer object. If you are using the same writer to generate more documents on the same stream, these properties are not automatically reset when you start a new document.

Was this article helpful?

0 0

Post a comment