Upgrade Guides for the Genero Application Server / GAS 2.00 upgrade guide |
The XML Preprocessor can be used as part of the BDL development process. It fetches data in a XML resource file to "fill" the content of a source file that contains the dollar tag expression.
$FGLASDIR/bin/fglxmlp -i src1.4gx -o src1.4gl -r resource.xrf
In this example, two source files will be "expanded" through the XML resource file. The resource file contains the definition of a complex 4GL record. The extension of files to be processed through the XML Preprocessor is .4gx. The extension for the resource file is .xrf (XML Resource File).
fglxmlp -i src1.4gx -o src1.4gl -r resource.xrf
fglxmlp -i src2.4gx -o src2.4gl -r resource.xrf
The resulting.4gl files are compiled and link as usual:
fglcomp -c src1.4gl
fglcomp -c src2.4gl
fgllink -o project.42r src1.42m src2.42m
01 FUNCTION useRecord (myRecord) 02 DEFINE myRecord $(record) ... 06 END FUNCTION
01 <?xml version="1.0" ?> 02 03 <RESOURCE_FILE> 04 <RESOURCE_LIST> 05 <RESOURCE Name="record"><![CDATA[ 06 RECORD 07 nb_columns INTEGER, 08 nb_lines INTEGER, 09 name CHAR (8) 10 END RECORD 11 ]]></RESOURCE> 12 </RESOURCE_LIST> 13 </RESOURCE_FILE>
01 FUNCTION useRecord (myRecord) 02 DEFINE myRecord 03 RECORD 04 nb_columns INTEGER 05 nb_lines INTEGER, 06 name CHAR (8) 07 END RECORD ... 15 END FUNCTION