om.XmlWriter.createChannelWriter

Creates an om.SaxDocumentHandler object writing to a channel object.

Syntax

om.XmlWriter.createChannelWriter(
   channel base.Channel )
  RETURNS om.SaxDocumentHandler
  1. channel is a base.Channel object reference.

Usage

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

The base.Channel object must exist and be open to receive data from the SAX document handler.

Example

The next example uses the channel to write to stdout, passing NULL as file name to the base.Channel.openFile() method:

DEFINE w om.SaxDocumentHandler
DEFINE ch base.Channel
...
LET ch = base.Channel.create()
CALL ch.openFile(NULL,"w")
LET w = om.XmlWriter.createChannelWriter(ch)
...