These are basic Cobol-data to/from Xml programs. They where written as replacements for the Dat2Xml and Xml2Dat programs in the cb2xml project.
Neither program supports:
In addition to the above, Xml2Data dopes not support:
If there is enough interest, I will look at enhancing the programs.
Advantages over cb2xml equivalents:
Differences from cb2xml's Dat2Xml and Xml2Dat:
-cobol - Cobol copybook used to "interpret" the data (you must supply either a cobol or cb2xml copybook -cb2xml - Cb2xml copybook used to "interpret" the data -input - Input file -output - Output file -font - Characterset used in the Cobol data file (e.g. IBM037 for US-EBCIDIC) -dropCopybookName - (true/false) wether to drop the cobol copybook name from the start of the Xml Tags -mainXmlTag - The outermost Xml tag to use (default coboldata) -fileOrganisation - "file organization" of the Cobol data file Text - Standard Windows/Unix text file (single byte character-set) FixedWidth - File where lines (records) are the same length no \n Mainframe_VB - Mainframe VB, file consists of <record-length><record-data> GNUCobol_VB - GNU Cobol VB, file consists of <record-length><record-data> -dialect - Cobol Dialect Mainframe - Mainframe cobol Futjitsu - Fujitsu PC cobol GNUCobol - GNU Cobol (little endian, ie intel) GNUCobolBE - GNU Cobol (big endian, ie IBM, Sun(oracle))
Cobol2Xml.newCobol2Xml(CobolCopybook) Cobol2Xml.newCobol2Xml(CobolCopybookInputStream, Copybook name) Cobol2Xml.newCb2Xml2Xml(Cb2xmlCopybook) Cobol2Xml.newCb2Xml2Xml(Cb2xmlCopybookInputStream, CopybookName)
A sample call:
1 2 Cobol2Xml.newCobol2Xml(opts.cobolCopybook) 3 .setFont(opts.font) 4 .setFileOrganization(opts.fileOrganisation) 5 .setDialect(opts.dialect) 6 .setDropCopybookNameFromFields(opts.dropCopybookName) 7 .setXmlMainElement(opts.mainXmlTag) 8 .cobol2xml(opts.inputFile, opts.outputFile); 9