Provides routines used to write XML content to a file, text file, or stream.

laz2_xmlwrite.pas provides procedures and types used to write XML content to a file, text file, or stream. laz2_xmlwrite.pas has classes in its implementation section that are used to perform serialization of XML content to the storage destination.

Copyright (c) 1999-2000 by Sebastian Guenther, sg@freepascal.org
Modified in 2006 by Sergei Gorelkin, sergei_gorelkin@mail.ru
Converted to use UTF-8 instead of widestrings by Mattias Gaertner.

This file is part of the LazUtils package.

Represent options enabled when writing XML content.
TXMLWriterFlag
is an enumerated type with values that represent options enabled when writing XML content. Values in TXMLWriterFlag are stored in the TXMLWriterFlags set type, and passed as an argument to the WriteXMLFile and WriteXML routines.
Enables writing Carriage Return (Decimal 13) characters in attribute values instead of the numeric character entity &xD;
Preserves whitespace in DOM Text nodes.
Set type used to store TXMLWriterFlag values.

TXMLWriterFlags is a set type used to store 0 or more values from the TXMLWriterFlag enumeration. TXMLWriterFlags indicates the options enabled when writing XML content. TXMLWriterFlags is the type passed as an argument to the WriteXMLFile procedure.

Writes an XML document to a file, text file, or stream.

WriteXMLFile is an overloaded procedure used to write an XML document to a file, text file, or stream. Overloaded variants provide the implementation details for each of the destinations, and create either TTextXMLWriter or TStreamXMLWriter class instances to store the XML document.

AFileName indicates the file name on the local file system where the XML content is stored. AFileName can contain UTF-8 encoded values, and must represent a valid file name. If the file in AFileName already exists, an exception will be raised.

Flags contains values from the TXMLWriterFlag enumeration. Use Flags to enable XML writing options in the routine. The default value for the argument is an empty set ([]), and indicates that no options are enabled in the routine.

XML document written in the routine.
File name where the XML content is stored.
Text file type where the content is written.
Stream where the XML document is stored.
Options enabled when writing the XML content.
Writes a DOM Node to a file, text file, or stream.

WriteXML is an overloaded procedure used to write a DOM Node to a file, text file, or stream. WriteXML calls one of the overloaded WriteXMLFile routines for a specific destination.

Element is a TDOMNode parameter that represents the DOM Document Node with the XML content written in the method. WriteXML ensures that Element is cast to a TXMLDocument type when calling the WriteXMLFile routine.

AFileName indicates the file name on the local file system where the XML content is stored. AFileName can contain UTF-8 encoded values, and must represent a valid file name. If the file in AFileName already exists, an exception will be raised.

Flags contains values from the TXMLWriterFlag enumeration. Use Flags to enable XML writing options in the routine. The default value for the argument is an empty set ([]), and indicates that no options are enabled in the routine.

DOM Node with the XML content written in the method.
File name where the XML content is stored.
Text file type where the content is written.
Stream where the XML document is stored.
Options enabled when writing the XML content.