5.32.10 WRITE

The WRITE command serializes the document object out to a specified file. It is used as the final step in creating an XML document from fields set inside your program. You will use the SET command one or more times prior to using the WRITE command to set up the data in the document.

Syntax:

Command

Keyword

Value

Developer notes

WRITE

FILE

value

  • Required. File path.
  • INDENT

    *YES

    Optional. Indent XML content.

    *NO

    Default.

    INDENT-AMOUNT

    integer

    Optional. Indent XML amount.
    Default is 0. If the amount is not zero then indent is enabled.

    DOCTYPE

    value

    Optional. Include XML <!DOCTYPE> element.

    PUBLIC

    value

    Conditional. The optional public component of the XML DOCTYPE declaration.

    OMIT-DECLARATION

    *YES

    Optional. Omit the XML declaration.

    *NO

    Default.

    ENCODING

     

    Optional. See ENCODING.
    Default encoding is UTF-8.

    BINDTRACE

    *YES

    Optional. Trace the outbound bind result.

    *NO

    Default.

    FILTER

    value

    Optional. Refer to FILTER for information on this keyword.

     

    Example

    WRITE FILE(/folder/file.xml) INDENT(*YES) BINDTRACE(*YES)