Hosted by Xmeta.net
Last updated 10NOV98
Here is the software:
The cals2ascii.xom OmniMark program converts CALS tables to formatted monospaced ASCII. The program is designed to be called, when a CALS table is detected, by another OmniMark conversion utility or it can be used in a stand-alone mode invoked directly from a command line.
When calling cals2ascii, the parent conversion program passes it the name of a file, where it has placed the detected CALS table, the name of the file where it wants the ASCII version of the table written, and any command line options.
Upon completion, cals2ascii writes the ASCII formatted table to the specified output file and exits. The calling program then reads the ASCII table and positions it as required in the body of the conversion it is performing.
The program as written currently supports the following elements in table cells, from the DTD that was supplied with it:
You can modify the supported elements by adding or deleting element rules in the cals2ascii program. You can also modify the programs behavior by adding or deleting matches in the build-outrow function. Some elements will not be possible to support due to the limited capabilities of displaying them in ASCII.
The find-start rule in the program contains a scan statement that reads in the DTD. Modify this statement so that it points to the location in your file system of the c2a.dtd file. This DTD can be modified to suit your needs, but I would recommend getting the program running before you change the DTD.
Three sample tables, cms-tbl1, cms-tbl2, and tbl1.sgml are included with this program. The monospaced ASCII versions of the samples, created by cals2ascii.xom, are in: cms1.out, cms2.out, and tbl1.out.
The following syntax example illustrates how the program can be called from a command line. Calling this program from another program will depend on the type of program and the operating system, but the structure of the command string should remain as shown.
NOTE: command line options surrounded by greater-than and less-that symbols are required. Those options surrounded by square brackets are optional.
omniv401 -s cals2ascii.xom <input> -of <output> [-d hsize 000] [-d ccode <ccpath>] [-d msg debug]
is an optional argument, if present it turns on the programs debugging messages.
This application was written by Craig Sampson sascrs@unx.sas.com.
I am releasing this code under the GNU General Public Licence. Please feel free to make use of the code, but remember that I have other commitments and will not be able to supply any technical support for it.