Build Template (BLDTPL)

The BLDTPL command aids in composing RPG API Express template (*.tpl) files. These are then converted using the CRTRPGTPL Command, which are in turn used with the Template/Composition Engine subprocedures (RXS_StartComposeEngine(), RXS_ComposeSection, RXS_ComposeVariable(), and RXS_GetComposeBuffer()) to compose XML documents.

Note: You will need to make manual modifications to the generated .tpl file prior to using it with the CRTRPGTPL Command.

Please follow our example on Creating an RXS Template to understand this process.

New in RXS 3.5.0:

Enhancements

  • The template generation process now supports whitespace in front of section delimiters - sections added to .tpl files before calling CRTRPGTPL no longer need to be fully left-aligned.
  • BLDTPL will now preserve namespace attributes when generating templates from sample XML, rather than converting them to variable placeholders.

Parameters

XML Input Stream File (SRCSTMF)

This is a required parameter.

Specify the fully-qualified file path of the XML stream file that will be processed to generate the template.

Possible Values:

character-value
IFS path to XML file that will be read to generate the template file.

Template Output Stream File (OUTSTMF)

This is a required parameter.

Specify the fully-qualified file path to the output stream file in the IFS. If this file does not exist, it will be created. If this file does exist, the generated XML template will overwrite any existing content. The user profile must have write authority to the file and directory.

Possible Values:

character-value
IFS path where the .tpl file will be written.

Number of Spaces to Indent (INDENT)

Specify how many spaces should be used when indenting nested elements in the generated .tpl file. If a value of 0 is specified, no elements will be indented.

Possible Values:

2
Nested elements will be indented by 2 spaces inside of parent elements. This is the default value.
numeric-value
Specify the number of spaces to indent each level of nesting, up to 9 spaces.