← Interactive API Explorer
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.
ParameterDescription
localNameThe 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.
ParameterDescription
localNameThe local name of the element.
nsThe 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.
ParameterDescription
localNameThe local name of the attribute.
valueThe value of the attribute.
void WriteString(String)
When overridden in a derived class, writes the given text content.
ParameterDescription
textThe 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.