Welcome !
What is TXT2XML ?
TXT2XML is a Rexx script that converts a text file to and from an XML
file using a COBOL copybook as reference. Rexx is a scripting language
created by IBM.
COBOL is a programming language mainly used on big computers also
called mainframes.
What is XML2COB ?
XML2COB is a complementary tool of TXT2XML. It generates a COBOL
copybook using an XML file as template. You can use this COBOL copybook
to convert XML files to and from text files with TXT2XML.
For which operating system ?
TXT2XML and XML2COB were, at the beginning, written for IBM MVS, OS/390
& Z/0S mainframe operating systems. But, thanks to Regina Rexx and Tiny Cobol, TXT2XML and
XML2COB run on Windows and Linux platforms. TXT2XML and XML2COB shoud
also run, but was never tested, on HP-UX, AIX, UNIX, OS/2, BeOS,
AmigaOS, Epoc32, AtheOS, QNX, MacOS X, SkyOS, ...
Is it a batch (shell) script or a GUI tool ?
Both ! Starting with version 1.25, calling TXT2XML and XML2COB without
any parameters will start, thanks to Thinlet,
a Java GUI (Graphical User
Interface). On IBM MVS, an ISPF is started if TXT2XML or XML2COB is
invoked without any parameters
Pre-requisites
To run TXT2XML and XML2COB on non-mainframe platforms (i.e. Windows,
Linux, ...), you have to install :
See the documentation for
more details.
How does it work ?
- During text to XML conversion, the COBOL items "meta-data" (name,
level, type, sign, default value, length, starting position and
occurence)
are read from the copybook. A record is read from the text file, item
data is extracted
from the text record and the XML element with his content is written in
the XML file.
The name of the XML element is the capitalized COBOL item name with
dashes ("-") translated to underscores("_").
- During XML to text conversion, the COBOL items "meta-data" are
read from the copybook. The XML elements are read one by one and
checked against
COBOL copybook items. At each XML first child element, a text record is
written
- During the COBOL copybook generation, the XML elements,
attributes and contents are analyzed to compute (level) or extract
(name, type, sign, length and occurence) their "meta-data". For
example, the name of the COBOL item is the XML element capitalized name
with underscores("_") translated to dashes ("-"). This analysis is
restarted at each XML first child element. At the end of the XML file,
the starting position of each item is computed for reporting and the
COBOL copybook is written.
Are there any limitations in the conversion or generation process ?
Yes. See the documentation
for more details. For example, REDEFINES clauses, two or more dimension
arrays in COBOL copybooks and XML entities are not supported.