[Overview][Types][Procedures and functions][Index] Reference for unit 'Laz2_XMLWrite' (#lazutils)

WriteXMLFile

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

Declaration

Source position: laz2_xmlwrite.pas line 38

procedure WriteXMLFile(

  doc: TXMLDocument;

  const AFileName: string;

  Flags: TXMLWriterFlags = []

); overload;

procedure WriteXMLFile(

  doc: TXMLDocument;

  var AFile: Text;

  Flags: TXMLWriterFlags = []

); overload;

procedure WriteXMLFile(

  doc: TXMLDocument;

  AStream: TStream;

  Flags: TXMLWriterFlags = []

); overload;

Arguments

doc

  

XML document written in the routine.

AFileName

  

File name where the XML content is stored.

Flags

  

Options enabled when writing the XML content.

Arguments

doc

  

XML document written in the routine.

AFile

  

Text file type where the content is written.

Flags

  

Options enabled when writing the XML content.

Arguments

doc

  

XML document written in the routine.

AStream

  

Stream where the XML document is stored.

Flags

  

Options enabled when writing the XML content.

Description

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. Please note that use of TXMLWriterFlag options like xwfAllowNullCharsInAttributeValue and xwfSpecialCharsInAttributeValue can result in an XML document that cannot be handled by a validating XML processor. The ReadXMLFile routine in LazUtils will accept and handle the values.

See also

WriteXML

  

Writes a DOM Node to a file, text file, or stream.


Version 3.2 Generated 2024-02-25 Home