You can invoke the xml2fd utility from the command line or from the AcuBench® Tools menu. To invoke it from the command line, type:
xml2fd options xmlfile ...
where:
"xmlfile ..." is one or more XML files. For each XML file named, separate ".fd" and ".sl" files are created.
Note that xml2fd is not designed to work with remote schema files. If the XML file refers to a remote schema file (using http syntax), the xml2fd utility will crash when trying to open the file. Make sure that the XML file used on this command line refers to a local schema or no schema at all.
Options include:
-d output_directory | Use this option to name the directory into which the ".fd" and ".sl" files should be placed. The default is the current directory. Note that the "-f" and "-s" options described below override this value. |
-f fd_directory | Use this option if you want the ".fd" file to be placed into a different directory than the ".sl" file. The ".fd" file is then stored in the named directory. |
-s sl_directory | Use this option if you want the ".sl" file to be placed into a different directory than the ".fd" file. The ".sl" file is then stored in the named directory. |
-n count | Use this option to specify the number of records to read from the XML file before calculating the sizes of data items and table occurrences and arriving at field descriptions in the FD. In very large XML files, it may not be desirable to read the entire file to derive the FD. On the other hand, it may be necessary to read more than one record to confirm a "best guess" for intended field descriptions in a record. The more data the utility reads, the better the guess will be, but the more time it will take to process the data and create the file. The value of "-n" must be numeric and greater than "0". |
-o occurs | Use this option to define a default value for any tables found in the XML file. Designating a numeric value greater than "0" instructs xml2fd to look for cases within the record where it is appropriate to assign an OCCURS clause, and gives a default number to assign in the clause. Schema parsed uses any maxOccurs attributes found, but DTDs don't have the syntax to describe a maximum number of occurrences. If records are read and the number of occurrences in any record is larger than the value you enter here, the larger value is used. |
Please note that in complex cases where an FD has more than one OCCURS clause and where the number of OCCURS differs, you must manually change the generated representation of the FD. | |
-p prefix | Use this option to prepend all data items in the FD with a standard prefix. This option is especially useful if the XML file
has elements that use reserved words as their names. For example, If your XML file looks like the following:
<company> <name>Acucorp</company> <address>8515 Miralani Drive</address> <city>San Diego</city> <state>CA</state> <ZIP>92126</ZIP> <remarks>This company sells development products for COBOL</remarks> </company> Then xml2fd will generate an FD that looks like:
07 company. 09 name pic x(30). 09 address pic x(30). 09 city pic x(15). 09 state pic x(2). 09 ZIP pic 9(5). 09 remarks pic x(128). However, ADDRESS and REMARKS are COBOL reserved words, so this would not compile. Instead, an error such as this would result: "Unexpected character. System will ignore it." If you use "-p cust-" when running xml2fd, then the utility generates: 07 cust-company. 09 cust-name pic x(30). 09 cust-address pic x(30). 09 cust-city pic x(15). 09 cust-state pic x(2). 09 cust-ZIP pic 9(5). 09 cust-remarks pic x(128). Using this option causes XFD NAME directives to be placed into the ".fd" file so that the resulting XFD file has data item names that match the XML file. |