fglxmlp XML preprocessor
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.
Usage:
$FGLASDIR/bin/fglxmlp -i src1.4gx -o src1.4gl -r resource.xrf Note:
- src1.4gx is the file to be processed through the XML Preprocessor.
- src1.4gl is the output file.
- resource.xrf is the XML resource file containing the definition of a complex 4GL record.
Using the XML Preprocessor
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 Files used in the example
src1.4gx :
01 FUNCTION useRecord (myRecord)
02 DEFINE myRecord $(record)
...
06 END FUNCTIONresource.xrf
:
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>The
output file src1.4gl :
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