例 10 の実行結果

次のセクションでは、実行される COBOL プログラムの出力および生成された XML ドキュメントを表示します。

COBOL 表示

プログラムを実行すると (run example10)、3 つの表示が生成されます。1 つ目は最初の診断メッセージの後に表示され、2 つ目は 2 番目の診断メッセージの後に表示され、3 つ目はテストの成功後に表示されます。

注:基礎となる XML パーサーの違いにより、例 10 の実行結果は Windows と UNIX とで異なります。パーサー エラーが発生した場合、現在の UNIX 実装では、エラーになった XML テキストの原因の行は表示されません (1 つ目の表示を参照)。これは、UNIX システムでは、基礎となる XML パーサー libxml がスキーマの検証をサポートしていないためです。UNIX では、スキーマによって検出されたエラーは報告されません (2 つ目の表示を参照)。ただし、3 つ目の表示はどちらの実装でも同じです。

1 つ目の表示

注:キーを押すと、プログラムが続行されます。

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:

2 つ目の表示

注:キーを押すと、プログラムが続行されます。
Windows では、2 つ目の表示は次のようになります。
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:
UNIX では、2 つ目の表示は次のようになります。
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:

3 つ目の表示

注:キーを押すと、プログラムが終了します。
 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 ドキュメントについては、適切な形式であることしか検証されず、スキーマに準拠していないことがあります。ただし、この例では、ドキュメントはスキーマに準拠しています。