次のセクションでは、実行される COBOL プログラムの出力および生成された XML ドキュメントを表示します。
プログラムを実行すると (run example10)、3 つの表示が生成されます。1 つ目は最初の診断メッセージの後に表示され、2 つ目は 2 番目の診断メッセージの後に表示され、3 つ目はテストの成功後に表示されます。
Windows では、1 つ目の表示は次のようになります。
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:
UNIX では、1 つ目の表示は次のようになります。
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:
UNIX では、3 つ目の表示は同じになりますが、XML ドキュメントについては、適切な形式であることしか検証されず、スキーマに準拠していないことがあります。ただし、この例では、ドキュメントはスキーマに準拠しています。