midrange.com code scratchpad |
Name:
RPG of Sample XMLi Template using nested SQL and parameter markers
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
01/19/2011 12:33:41 am
|
IP:
Logged
|
|
Description:
RPG for http://code.midrange.com/63241fb4e9.html
|
Code:
- H OPTION(*NODEBUGIO:*NOEXPDDS:*SRCSTMT)
- H DFTACTGRP(*NO)
-
- **************************************************************************
- * This example uses XMLi to write XML in the IFS using a template.
- *
- * To run a template you do the following:
- * 1) Tell XMLi which template to use, providing a name and IFS location.
- * 2) Set any parameters the template will need.
- * 3) Run the template.
- *
- * You only need to load once, you can set parms and run as many times as needed.
- **************************************************************************
-
- // BNDDIR for XMLI2...
- H BNDDIR('XMLILIB/XMLI2')
- **********************************************************************
- // Copybook for XMLI2...
- /include xmlilib/qrpglesrc,xmli2_h
- *********************************************************************
- /free
-
- // Load the template...
- xmli_loadTemplate('TEMP5' : '/XMLi/Examples/Templates/Example15.xml');
-
- // SQL will retrieve order details for the passed customer...
- // This template has a nested SQL statement...
- xmli_setParm(1 : 'CUSTOMER1');
-
- // Run the template...
- xmli_runTemplate();
-
- // At this point the xml template has run and the result should be
- // written to XML file /XMLi/Examples/Results/Example15.xml
-
- // Unload the template...
- xmli_unloadTemplate('TEMP5');
-
- *INLR = *on;
- return;
-
- /end-free
|
|
|