System::Xml::XmlTextWriter class

XmlTextWriter class

Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations.

class XmlTextWriter : public System::Xml::XmlWriter

Methods

MethodDescription
Close() overrideCloses this stream and the underlying stream.
Flush() overrideFlushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.
get_BaseStream()Returns the underlying stream object.
get_Formatting()Indicates how the output is formatted.
get_Indentation()Returns how many IndentChars to write for each level in the hierarchy when XmlTextWriter::set_Formatting is set to Formatting::Indented.
get_IndentChar()Returns which character to use for indenting when XmlTextWriter::set_Formatting is set to Formatting::Indented.
get_Namespaces()Returns a value indicating whether to do namespace support.
get_QuoteChar()Returns which character to use to quote attribute values.
get_WriteState() overrideReturns the state of the writer.
get_XmlLang() overrideReturns the current xml:lang scope.
get_XmlSpace() overrideReturns an XmlSpace representing the current xml:space scope.
LookupPrefix(String) overrideReturns the closest prefix defined in the current namespace scope for the namespace URI.
set_Formatting(System::Xml::Formatting)Indicates how the output is formatted.
set_Indentation(int32_t)Sets how many IndentChars to write for each level in the hierarchy when XmlTextWriter::set_Formatting is set to Formatting::Indented.
set_IndentChar(char16_t)Sets which character to use for indenting when XmlTextWriter::set_Formatting is set to Formatting::Indented.
set_Namespaces(bool)Sets a value indicating whether to do namespace support.
set_QuoteChar(char16_t)Sets which character to use to quote attribute values.
WriteBase64(ArrayPtr<uint8_t>, int32_t, int32_t) overrideEncodes the specified binary bytes as base64 and writes out the resulting text.
WriteBinHex(ArrayPtr<uint8_t>, int32_t, int32_t) overrideEncodes the specified binary bytes as binhex and writes out the resulting text.
WriteCData(String) overrideWrites out a block containing the specified text.
WriteCharEntity(char16_t) overrideForces the generation of a character entity for the specified Unicode character value.
WriteChars(ArrayPtr<char16_t>, int32_t, int32_t) overrideWrites text one buffer at a time.
WriteComment(String) overrideWrites out a comment **** containing the specified text.
WriteDocType(const String&, const String&, const String&, const String&) overrideWrites the DOCTYPE declaration with the specified name and optional attributes.
WriteEndAttribute() overrideCloses the previous XmlTextWriter::WriteStartAttribute call.
WriteEndDocument() overrideCloses any open elements or attributes and puts the writer back in the Start state.
WriteEndElement() overrideCloses one element and pops the corresponding namespace scope.
WriteEntityRef(const String&) overrideWrites out an entity reference as &name;.
WriteFullEndElement() overrideCloses one element and pops the corresponding namespace scope.
WriteName(const String&) overrideWrites out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation.
WriteNmToken(const String&) overrideWrites out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation.
WriteProcessingInstruction(String, String) overrideWrites out a processing instruction with a space between the name and text as follows: .
WriteQualifiedName(const String&, const String&) overrideWrites out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.
WriteRaw(ArrayPtr<char16_t>, int32_t, int32_t) overrideWrites raw markup manually from a character buffer.
WriteRaw(const String&) overrideWrites raw markup manually from a string.
WriteStartAttribute(const String&, const String&, const String&) overrideWrites the start of an attribute.
WriteStartDocument() overrideWrites the XML declaration with the version “1.0”.
WriteStartDocument(bool) overrideWrites the XML declaration with the version “1.0” and the standalone attribute.
WriteStartElement(const String&, const String&, const String&) overrideWrites the specified start tag and associates it with the given namespace and prefix.
WriteString(const String&) overrideWrites the given text content.
WriteSurrogateCharEntity(char16_t, char16_t) overrideGenerates and writes the surrogate character entity for the surrogate character pair.
WriteWhitespace(String) overrideWrites out the given white space.
XmlTextWriter(const SharedPtr<IO::Stream>&, const SharedPtr<Text::Encoding>&)Creates an instance of the XmlTextWriter class using the specified stream and encoding.
XmlTextWriter(const String&, const SharedPtr<Text::Encoding>&)Creates an instance of the XmlTextWriter class using the specified file.
XmlTextWriter(const SharedPtr<IO::TextWriter>&)Creates an instance of the XmlTextWriter class using the specified TextWriter.

Typedefs

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

Remarks

It is recommended to use the XmlWriter class instead.

Objects of this class should only be allocated using System::MakeObject() function. Never create instances of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

See Also