Question:
My application calls the ACUCOBOL-GT library routine named C$XML. It is supported? What are other ways to handle XML?
Answer:
Though isCOBOL supports XML streams natively in several powerful methods, it also supports C$XML specifically for ACUCOBOL-GT compatibility. This document will discuss each of these options
C$XML
C$XML support was added in isCOBOL version 2015 Release 1, and enhanced with more op-codes in 2016 Release 1.
There are just a few op-codes that we don't support yet, but will consider supporting as our customers express a need for them.
isCOBOL XML Handling options
isCOBOL provides an internal object named com.iscobol.rts.XMLStream.
This object can be used by a COBOL program read and write XML files and streams easily.
XMLStream is documented in the isCOBOL Language Reference Guide.
Example code is provided in the sample directory installed with isCOBOL (sample/issamples/s-objects/xml.cbl).
You can view the source and execute the sample program by running "isCOBOL samples" from the Start Menu and clicking on the Objects tab.
isCOBOL also supports the XML PARSE and XML GENERATE procedure division statements. For more information, see the KB article What are all of the options for a COBOL program to read and write XML files? and the isCOBOL language reference manual.
Java XML Support
You can also use the Java language XML APIs and tools available to a Java programmer. See https://www.oracle.com/java/technologies/ and search for XML.
For example, to parse local XML files or XML from a URL, a COBOL program can use a Java package named JDOM (http://www.jdom.org).
The sample program attached uses JDOM to parse an xml file from a URL.
Here are some other examples of extensions to the Java Platform to help the Java developer when building XML-based applications:
Article ID: 42
Created: August 31, 2009
Last Updated: August 5, 2022
Author: Support KB Author
Online URL: https://support.veryant.com/phpkb/article.php?id=42