www.krengeltech.com

RXS_loadTpl

From Wiki

User Guide

Contents

Description

Use this subprocedure to load a new template into the Template Engine. A template is essentially a file in the IFS that contains XML with named sections and variable data placeholders. Commonly programmers reuse templates across applications or web services. For instance, if many RPG web service applications use the same envelope tag, a separate file can store the header and footer of the envelope (e.g. envelope_header.tpl and envelope_footer.tpl) that encapsulates contents composed using a variety of content templates.

Prototype

     D RXS_loadTpl...
     D                 pr
     D  pFile                              value like(RXS_FilePath)
     D  pSecStart                    20a   const varying options(*nopass)
     D  pSecEnd                      20a   const varying options(*nopass)
     D  pVarStart                    20a   const varying options(*nopass)
     D  pVarEnd                      20a   const varying options(*nopass)

Parameters

pFile
Specify the template file to load into the Template Engine. You can pass a fully qualified path (e.g. ‘/www/rxs/template/mytemplate.tpl’) or a relative path based on the default template directory (e.g. ‘mytemplate.tpl’). The default template directory can be found in physical file RXSCFG.
pSecStart
Override the default section start delimiter found in RXSCFG with one of your own.
pSecEnd
Override the default section end delimiter found in RXSCFG with one of your own.
pVarStart
Override the default variable data placeholder start delimiter found in RXSCFG with one of your own.
pVarEnd
Override the default variable data placeholder end delimiter found in RXSCFG with one of your own.

Return value

None.

Notes / Examples

If your program uses the default section and variable data placeholder delimiters then you can simply use the pFile parameter and not pass the rest (i.e. RXS_loadTpl(‘myfile.tpl’) ).