The structure of the XML elements is expected to match the structure of the RPG variable.
<?targetname data value ?>
D libname S 10A
/free
XML-INTO libname %XML(xmldoc : option)
Sample XML for XML-INTO libname | path option |
---|---|
<libname>data</libname> | |
<library>data</library> | 'path=library' |
<info><library>data</library></info> | 'path=info/library' |
D sites S 25A DIM(3)
/free
XML-INTO sites(n) %XML(xmldoc : option)
Sample XML for XML-INTO sites | path option |
---|---|
<sites>data</sites> | blank |
<custsites>data</custsites> | 'path=custsites' |
<info><sites>data</sites></info> | 'path=info/sites' |
D tabname S 10A DIM(5)
/free
XML-INTO tabname %XML(xmldoc : opts)
Sample XML for XML-INTO tabname | path option |
---|---|
<tabname>data</tabname> | blank |
<library>data</library> | 'path=library' |
<info><library>data</library></info> | 'path=info/library' |
D pgm DS
D name 10A
D lib 10A
D pgm DS OCCURS(5)
D name 10A
D lib 10A
/free
XML-INTO pgm %XML(xmldoc : option)
Sample XML for XML-INTO pgm | path option |
---|---|
|
blank |
|
'path=program' |
|
'path=api/program' |
Note: The subfield information can come from XML elements or XML attributes. The following show other valid ways to specify the XML for the subfields of the data structure. The designer of the XML document can use either attributes or elements freely when representing the XML data for a scalar subfield.
<pgm name="data" lib="data"/>
OR
<pgm name="data">
<lib>data</lib>
</pgm>
D sites S 25A DIM(3)
/free
XML-INTO sites %XML(xmldoc : option)
Sample XML for XML-INTO sites | path option |
---|---|
|
blank |
|
'path=info/custsites' |
D pgm DS DIM(3) QUALIFIED
D name 10A
D lib 10A
/free
XML-INTO pgm %XML(xmldoc : option)
Sample XML for XML-INTO pgm | path option |
---|---|
|
blank |
|
'path=programs/pgm' |
Note: The three "pgm" XML elements have the name and lib information specified in various combinations of XML elements and XML attributes. The designer of the XML document can use either attributes or elements freely when representing the XML data for a scalar subfield.
D qualname DS QUALIFIED
D name 10A
D lib 10A
D dtaaraInfo DS QUALIFIED
D dtaara LIKEDS(qualname)
D type 10I 0
D value 100a
/free
XML-INTO dtaaraInfo %XML(xmldoc : option)
Sample XML for XML-INTO dtaaraInfo | path option |
---|---|
|
blank |
|
'path=sys/obj/dta' |
D myCommArea DS
D total 20u 0
D custType DS qualified
D name 50a varying
D id_no 10i 0
D city 20a
D custHdlr PR
D commArea likeds(myCommArea)
D custinfo likeds(custType) dim(5)
D numElems 10u 0 const
/free
XML-INTO %HANDLER(custHdlr : myCommArea) %XML(xmldoc : option)
Note: The path option is required when %HANDLER is specified.
Sample XML for XML-INTO %HANDLER(custHdlr:x) | path option |
---|---|
|
'path=info/cust' |
D myCommArea DS
D total 20u 0
D nameHdlr PR
D commArea likeds(myCommArea)
D names 10a dim(5)
D numNames 10u 0 const
/free
XML-INTO %HANDLER(nameHdlr : myCommArea) %XML(xmldoc : option)
Note: The path option is required when %HANDLER is specified.
Sample XML for XML-INTO %HANDLER(nameHdlr:x) | path option |
---|---|
|
'path=info/names' |