Namespace: System.Xml
XmlWriter
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data.
Methods (7)
void WriteStartDocument
When overridden in a derived class, writes the XML declaration with the version "1.0".
void WriteStartElement(String)
When overridden in a derived class, writes out a start tag with the specified local name.
| Parameter | Description |
|---|---|
| localName | The local name of the element. |
void WriteStartElement(String,String)
When overridden in a derived class, writes the specified start tag and associates it with the given namespace.
| Parameter | Description |
|---|---|
| localName | The local name of the element. |
| ns | The namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix, the writer automatically writes that prefix also. |
void WriteAttributeString(String,String)
When overridden in a derived class, writes out the attribute with the specified local name and value.
| Parameter | Description |
|---|---|
| localName | The local name of the attribute. |
| value | The value of the attribute. |
void WriteString(String)
When overridden in a derived class, writes the given text content.
| Parameter | Description |
|---|---|
| text | The text to write. |
void WriteEndElement
When overridden in a derived class, closes one element and pops the corresponding namespace scope.
void WriteEndDocument
When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state.