The following sections display the output of the COBOL program that is run and the XML document that is generated.
Running the program (run example10) produces three displays: the first is shown after the first diagnostic message, the second is shown after the second diagnostic message, and the third is displayed after some successful tests.
For Windows, the first display would be illustrated as:
Example-10 - Illustrate diagnostics for invalid documents and documents that are not well-formed XML TEST WELLFORMED-FILE - not well-formed ... Error: 28[34] - in function: LoadDocument MSXML 6.0 parse error code: 0xc00cee3b The name in the end tag of the element must match the element type in the start\ tag. line 13, position 21 </non-address-struct> <!-- intentional tag mismatch --> --------------------| C:\xmlext\examples\x-addressa1.xml HRESULT: 0x80004005 ... wellformedness test failed (as it should). Press a key to continue:
For UNIX, the first display would be shown as follows:
Example-10 - Illustrate diagnostics for invalid documents and documents that are not well-formed XML TEST WELLFORMED-FILE - not well-formed ... Error: 28[2] - in function: LoadDocument /usr/xmlext/examples/x-addressa1.xml 13: parser error : Opening and ending tag mismatch: address-struct line 2 and n\ on-address-struct </non-address-struct> <!-- intentional tag mismatch --> ^ ... wellformedness test failed (as it should). Press a key to continue:
XML TEST WELLFORMED-FILE - well-formed & invalid ... ... wellformedness test succeeeded. XML VALIDATE FILE - well-formed - invalid ... Error: 28[34] - in function: LoadDocument MSXML 6.0 parse error code: 0xc00ce201 Error parsing 'ABCDE' as decimal datatype. The element 'zip' with value 'ABCDE\ ' failed to parse. line 9, position 20 <zip>ABCDE</zip> <!-- intentional nonnumeric zip code --> -------------------| C:\xmlext\examples\x-addressa2.xml HRESULT: 0x80004005 ... validation failed (as it should). Press a key to continue:
XML TEST WELLFORMED-FILE - well-formed & invalid ... ... wellformedness test succeeeded. XML VALIDATE FILE - well-formed - invalid ... Error: 28[4] - in function: LoadDocument /usr/xmlext/examples/x-addressa2.xml 9: element zip: Schemas validity error : Element 'zip': 'ABCDE' is not a valid \ value of the atomic type 'type_Q8_example-a'. ... validation failed (as it should). Press a key to continue:
XML TEST WELLFORMED-FILE - well-formed - valid ... ... wellformedness test succeeeded. XML VALIDATE FILE - well-formed - valid ... ... validation successful. Status: +0000 Press a key to terminate:
For UNIX, the third display would be the same, but the XML document has only been verified to be well-formed and might not conform to the schema; however, for this example, the document does conform to the schema.