Previous Topic Next topic Print topic


Execution results for example 10

The following sections display the output of the COBOL program that is run and the XML document that is generated.

COBOL display

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.

Note: Because of differences in the underlying XML parsers, the results of running Example 10 vary between Windows and UNIX. When a parser error occurs, the current UNIX implementation does not display the offending line of XML text in error (as shown in the first display) because on UNIX systems, the underlying XML parser, libxml, does not support schema validation. Under UNIX, errors that would be detected by a schema are not reported (as illustrated in the second display). The third display, however, is the same under both implementations.

First display

Note: Pressing a key will cause the program to continue.

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:

Second display

Note: Pressing a key will cause the program to continue.
For Windows, the second display would be illustrated as:
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:
For UNIX, the second display would be shown as follows:
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:

Third Display

Note: Pressing a key will terminate the program.
 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.

Previous Topic Next topic Print topic