X hits on this document





89 / 120

driven parse of an XML document. In a event-driven parse, the initiator registers a

handler which the XML parser invokes with each XML construct found in the document.

For example, the start and end of an XML element would be reported as two separate

events. XML generation in COBOL is accomplished through the use of the XML

GENERATE statement, which, given a COBOL data structure and an output buffer, will

generate XML that has the same hierarchical organization as the data structure [37, 44].

By default, the XML GENERATE statement will form XML element and attribute names

using the name of each member in the COBOL data structure. This can be less than ideal

in circumstances where data structure members have cryptic names that don't conform to

the spirit of XML where each XML element and attribute is given a name that describes

its content. Fortunately, Micro Focus COBOL provides the capability to assign custom

XML element and attribute names to each data structure member, which allows for

defining an XML Schema that has meaningful element and attribute names [37].

In the exercise which accompanies this section, we are asked to create a language-

neutral XML interface to the “legacy” SMPCALC.cbl application program and invoke it

from a Java program which incidentally makes it reusable to other Java programs. To

describe an XML interface to the legacy COBOL program so that other programs may

consume it, an XML Schema must be created; this can be done with a tool that can

generate XML Schema from a COBOL data declaration, or by hand using an XML editor.

Once an XML interface has been described using XML Schema, it is necessary to

implement XML marshalling layers between the calling Java program and the legacy


Document info
Document views282
Page views283
Page last viewedThu Oct 27 22:24:40 UTC 2016