Program description for example 9

Before any other XML statement may be executed, the XML INITIALIZE statement must be successfully executed. Since it is possible for XML INITIALIZE to fail, the return status must be checked before continuing.

Data is exported from the data item Address-Struct (as defined in the copybook, s-struct.cpy) to an XML document with the filename of address09a.xml using the XML EXPORT FILE statement.

Next, the content of the XML document is transformed from the format that was used in Example 2 with an XML TRANSFORM FILE statement producing the file, address09b.xml, and then transformed back into the original output format.

Next, the content of the XML document is imported from the file, address09c.xml, and placed in the same data item using the XML IMPORT FILE statement.

Subsequently, the content of the XML document, address09c.xml, is transformed using the example09.xsl stylesheet to create the file, address09d.xml. This adds all of the COBOL attributes to address09d.xml.

Finally, the XML interface is terminated with the XML TERMINATE statement.

If any of the statements terminate unsuccessfully, the XML GET STATUS-TEXT statement is called.