Related pages

Typical Problems

Validating Links

Within an instance document that validates, I have xlink:href attributes with an incorrect identifier, pointing to an object of the wrong type (an easy mistake when hand-converting samples).

Conclusion

For now, I will go the Python route using the standard unittest built into Python and as much XPath declarative style as possible.

This seems to carry the least baggage and be easiest for non-programmers to read and possibly extend.

Possible Solutions

Python-based testing

Write some Python code which uses XPath expressions as much as possible to give a declarative flavour to the testing code but is still free to use loops and other pattern matching when that is clearer:

A Proper "XML Unit Test environment"

SUT

The first is a namespace and vocabulary for embedding test cases into sample XML documents, designed to highlight what is legal and what is not legal in the vocabulary defined in the schema under test. This aspect is independent of what schema language is used and can in theory be applied to any schema language with automatic validation tools.

The second part is a Java implementation using JUnit for testing a W3C Schema with embedded Schematron schema. This implementation reads SUT test suite descriptions written in XML with embedded test cases as described above and then creates a JUnit test suite that can be executed inside JUnit in the usual way.