om.XmlWriter.createFileWriter

Creates an om.SaxDocumentHandler object writing to a file.

Syntax

om.XmlWriter.createFileWriter(
   filename STRING )
  RETURNING result om.SaxDocumentHandler
  1. filename is the path to the file.

Usage

The om.XmlWriter.createFileWriter() class method creates an om.SaxDocumentHandler object that will write to the specified file when using the om.SaxDocumentHandler methods.

The file is created if it does not exist. If the file cannot be created, the method returns NULL.

DEFINE w om.SaxDocumentHandler
...
LET w = om.XmlWriter.createFileWriter("mydata.xml")
IF w IS NULL THEN
   ERROR "Could not create file."
   EXIT PROGRAM 1
END IF