Example 7 Export file, test well-formed file, and validate file

This COBOL program illustrates how an XML document is generated from a COBOL data item and then how the syntax and content of an XML document may be verified.

The program first writes (or exports) an XML document file from the content of a COBOL data item. Then the program verifies that the generated document is well-formed. Finally, the program verifies that the content of the document conforms to the schema file.

Note: On UNIX systems, the underlying XML parser, libxml, does not support schema validation.

This example uses the following XML statements: