XMLGEN Compiler directive

Specifies whether the Compiler should produce an XML model file for either the file section or the working-storage section data items defined in the program.

Syntax:

>>-.--XMLGEN--.------------.---.---><
   |          +-(ws)-------+---|
   |          +-(WS)-------+---|   
   |          +-(pathname)-+---|
   |          +-($env-var)--+--|   
   |                           |     
   +--NOXMLGEN-----------------+

Parameters

none
When you use XMLGEN without any parameters, it generates an XML model file in the project directory, containing a model for file section data items only (no working-storage section data items).
Note: The XML model file must be accessible to the XML extensions run-time environment. To make the file accessible, either add it to the system path, or move it to the directory from which the program is run.
WS and ws
Generate a model that includes working-storage section data items only (no file section data items).
pathname
An absolute or relative path to use as an alternative location for the generated XML model file.
Note: To specify a path that starts with the letters ws or WS, begin the path specification with a slash (/) or a dot slash (./) to prevent XMLGEN from misinterpreting the ws characters as a WS or ws parameter specification.
$env-var
An environment variable set to an absolute or relative path to use as an alternative location for the generated XML model file.

Properties:

Default: NOXMLGEN
Phase: Syntax check
$SET: Any

Comments:

  • XMLGEN produces one XML model file containing either file section data items or working-storage data items depending on whether or not ws or WS is specified. It does not produce both the file section and working-storage section descriptions in one compilation.
  • The XML model output filename is:
    source-name.xml
    where source-name is the prefix of the specified COBOL file.
  • XMLGEN overwrites existing output files.
  • To generate an XML model file with working-storage section data descriptions in an alternative directory, specify the XMLGEN directive twice with the first XMLGEN providing the pathname or $env-var parameter, followed by the second providing the WS or ws parameter. Reversing this order results in an output file in the specified path but with file section data items instead of working-storage data items.

Examples:

To generate an XML model file in the project directory, containing file section data items:

XMLGEN

To generate an XML model file in the c:\users\bob directory, containing file section data items:

XMLGEN(c:\users\bob)

To generate an XML model file in the project directory, containing working-storage data items:

XMLGEN(ws)

To generate an XML model file in the c:\users\bob directory, containing working-storage data items:

XMLGEN(c:\users\bob) XMLGEN(ws)

To generate an XML model file in the directory specified by the XMLPATH environment variable, containing working-storage data items:

XMLGEN($XMLPATH) XMLGEN(ws)