Design and Implementation of a validating XML parser in Haskell: Master's thesis; University of Applied Sciences Wedel | ||
---|---|---|
Prev | Next |
The validating XML parser of the Haskell XML Toolbox was elaborately tested with the XML Test Suites (XML TS) from the W3C [WWW02].
These XML TS consist of over 2000 test files for the XML 1.0 specification [WWW01] and an associated test report. The test report contains background information on conformance testing for XML as well as test descriptions for each of the test files.
The test suite consists of two basic test types: Binary Tests and Output Tests. Binary conformance tests are documents that should be accepted or rejected by the parser. Output tests are tests for valid documents which are paired with a reference file as the canonical representation [WWW03] of the input file. By comparing the output of the XML parser with the reference file, it can be ensured that the parser provides the correct information.
There exist four different tests cases:
The XML parser is required to accept these documents. For most test cases a reference file exists.
A validating XML parser has to report a violation of some validity constraint. The reported error must meet the test case description.
An XML parser has to report a fatal error. The reported error must meet the test case description.
An XML parser is permitted to ignore these errors, or to report them. If an error is reported, the error message must meet the test case description.
By using these tests, it could be ensured that the validating XML parser of the Haskell XML Toolbox covers most aspects of the XML 1.0 specification [WWW01]. Because the XML TS is not complete, it is not possible to claim conformance with the specification itself, but only with the XML TS. At the moment the parser passes about 95% of these test cases, see Section A.2 for further details.