Xmldoc_Object SaveFile Method

Converts a DOM tree document to the XML text format and writes the data to a file.

xmldoc_object.SaveFile(output_file, options)

Prerequisites

None

Parameters

output_file

A required String expression that contains the name of the file to receive the XML text output data.

options

An optional numeric expression that specifies a bit mask of format-related options. The bits in the mask are defined as shown in the table below. If omitted, all option bits are assumed to be 0.

Remarks

This method creates XML text data from a DOM tree and writes it to a file. It throws an exception if any error occurs during conversion. If an error occurs, check the values of xmldoc_object.ErrorCode and xmldoc_object.Message to determine why the conversion failed.

The options parameter is composed of bit flags that are defined in Table 19-122. Bits not shown in the table should be set to 0.

Table 19-122: options Parameter, Bit Flags

Bit Mask Name Description

&H01

Format

Format the output by adding new-lines and indenting nested elements.

&H02

Suppress declarations

Suppress output of the standard XML declarations comments at the start of the output.

&H04

Suppress empty tags

Suppress output of empty sections.

Examples

Dim doc As XmlDoc
doc = New XmlDoc("My_doc")
. . .
doc.SaveFile("/flash/xml/test.xml")

See Also

XML Classes | xmldoc_object.ErrorCode | XmlDoc.LoadFile | xmldoc_object.Message | xmldoc_object.SaveString