System::Xml::XmlWriter class

XmlWriter class

Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data.

class XmlWriter : public System::IDisposable

Methods

MethodDescription
virtual Close()When overridden in a derived class, closes this stream and the underlying stream.
static Create(const String&)Creates a new XmlWriter instance using the specified filename.
static Create(const String&, SharedPtr<XmlWriterSettings>)Creates a new XmlWriter instance using the filename and XmlWriterSettings object.
static Create(const SharedPtr<IO::Stream>&)Creates a new XmlWriter instance using the specified stream.
static Create(const SharedPtr<IO::Stream>&, SharedPtr<XmlWriterSettings>)Creates a new XmlWriter instance using the stream and XmlWriterSettings object.
static Create(const SharedPtr<IO::TextWriter>&)Creates a new XmlWriter instance using the specified TextWriter.
static Create(const SharedPtr<IO::TextWriter>&, SharedPtr<XmlWriterSettings>)Creates a new XmlWriter instance using the TextWriter and XmlWriterSettings objects.
static Create(const SharedPtr<Text::StringBuilder>&)Creates a new XmlWriter instance using the specified Text::StringBuilder.
static Create(const SharedPtr<Text::StringBuilder>&, SharedPtr<XmlWriterSettings>)Creates a new XmlWriter instance using the Text::StringBuilder and XmlWriterSettings objects.
static Create(const SharedPtr<XmlWriter>&)Creates a new XmlWriter instance using the specified XmlWriter object.
static Create(const SharedPtr<XmlWriter>&, SharedPtr<XmlWriterSettings>)Creates a new XmlWriter instance using the specified XmlWriter and XmlWriterSettings objects.
Dispose() overrideReleases all resources used by the current instance of the XmlWriter class.
virtual Flush()When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.
virtual get_Settings()Returns the XmlWriterSettings object used to create this XmlWriter instance.
virtual get_WriteState()When overridden in a derived class, gets the state of the writer.
virtual get_XmlLang()When overridden in a derived class, gets the current xml:lang scope.
virtual get_XmlSpace()When overridden in a derived class, gets an XmlSpace representing the current xml:space scope.
virtual LookupPrefix(String)When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI.
virtual WriteAttributes(SharedPtr<XmlReader>, bool)When overridden in a derived class, writes out all the attributes found at the current position in the XmlReader.
WriteAttributeString(const String&, const String&, const String&)When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.
WriteAttributeString(const String&, const String&)When overridden in a derived class, writes out the attribute with the specified local name and value.
WriteAttributeString(const String&, const String&, const String&, const String&)When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value.
virtual WriteBase64(ArrayPtr<uint8_t>, int32_t, int32_t)When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text.
virtual WriteBinHex(ArrayPtr<uint8_t>, int32_t, int32_t)When overridden in a derived class, encodes the specified binary bytes as BinHex and writes out the resulting text.
virtual WriteCData(String)When overridden in a derived class, writes out a block containing the specified text.
virtual WriteCharEntity(char16_t)When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.
virtual WriteChars(ArrayPtr<char16_t>, int32_t, int32_t)When overridden in a derived class, writes text one buffer at a time.
virtual WriteComment(String)When overridden in a derived class, writes out a comment **** containing the specified text.
virtual WriteDocType(const String&, const String&, const String&, const String&)When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes.
WriteElementString(const String&, const String&)Writes an element with the specified local name and value.
WriteElementString(const String&, const String&, const String&)Writes an element with the specified local name, namespace URI, and value.
WriteElementString(const String&, const String&, const String&, const String&)Writes an element with the specified prefix, local name, namespace URI, and value.
virtual WriteEndAttribute()When overridden in a derived class, closes the previous XmlWriter::WriteStartAttribute(String,String) call.
virtual WriteEndDocument()When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state.
virtual WriteEndElement()When overridden in a derived class, closes one element and pops the corresponding namespace scope.
virtual WriteEntityRef(const String&)When overridden in a derived class, writes out an entity reference as &name;.
virtual WriteFullEndElement()When overridden in a derived class, closes one element and pops the corresponding namespace scope.
virtual WriteName(const String&)When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
virtual WriteNmToken(const String&)When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).
virtual WriteNode(SharedPtr<XmlReader>, bool)When overridden in a derived class, copies everything from the reader to the writer and moves the reader to the start of the next sibling.
virtual WriteNode(SharedPtr<XPath::XPathNavigator>, bool)Copies everything from the XPathNavigator object to the writer. The position of the XPathNavigator remains unchanged.
virtual WriteProcessingInstruction(String, String)When overridden in a derived class, writes out a processing instruction with a space between the name and text as follows: .
virtual WriteQualifiedName(const String&, const String&)When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.
virtual WriteRaw(ArrayPtr<char16_t>, int32_t, int32_t)When overridden in a derived class, writes raw markup manually from a character buffer.
virtual WriteRaw(const String&)When overridden in a derived class, writes raw markup manually from a string.
WriteStartAttribute(const String&, const String&)Writes the start of an attribute with the specified local name and namespace URI.
virtual WriteStartAttribute(const String&, const String&, const String&)When overridden in a derived class, writes the start of an attribute with the specified prefix, local name, and namespace URI.
WriteStartAttribute(const String&)Writes the start of an attribute with the specified local name.
virtual WriteStartDocument()When overridden in a derived class, writes the XML declaration with the version “1.0”.
virtual WriteStartDocument(bool)When overridden in a derived class, writes the XML declaration with the version “1.0” and the standalone attribute.
WriteStartElement(const String&, const String&)When overridden in a derived class, writes the specified start tag and associates it with the given namespace.
virtual WriteStartElement(const String&, const String&, const String&)When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix.
WriteStartElement(const String&)When overridden in a derived class, writes out a start tag with the specified local name.
virtual WriteString(const String&)When overridden in a derived class, writes the given text content.
virtual WriteSurrogateCharEntity(char16_t, char16_t)When overridden in a derived class, generates and writes the surrogate character entity for the surrogate character pair.
virtual WriteValue(SharedPtr<Object>)Writes the object value.
virtual WriteValue(const String&)Writes a String value.
virtual WriteValue(bool)Writes a Boolean value.
virtual WriteValue(DateTime)Writes a DateTime value.
virtual WriteValue(DateTimeOffset)Writes a DateTimeOffset value.
virtual WriteValue(double)Writes a Double value.
virtual WriteValue(float)Writes a single-precision floating-point number.
virtual WriteValue(Decimal)Writes a Decimal value.
virtual WriteValue(int32_t)Writes a Int32 value.
virtual WriteValue(int64_t)Writes a Int64 value.
virtual WriteWhitespace(String)When overridden in a derived class, writes out the given white space.

Typedefs

TypedefDescription
PtrAn alias for shared pointer to an instance of this class.

See Also