How being schema-valid is different

from being pregnant

C. M. Sperberg-McQueen

Poster presentation at XML 2003, Philadelphia, December 2003

Validation with some schema languages (e.g. XML 1.0 and SGML DTDs) is a black-or-white question: either the document is (wholly) valid or it's not valid (at all). There are no gray areas: a document cannot be ‘mostly valid’ any more than one can be ‘a little bit pregnant’.
The theoretical information content of a validation result in these systems is thus exactly one bit: yes/valid or no/invalid. In practice good validators try to provide a little more information about errors, but quality of error diagnostics varies and error handling is not standardized.
In other languages (e.g. XML Schema), validity assessment is designed to provide more than one binary digit of useful information. XML Schema allows various forms of partial validation:
In XML Schema, schema-validity is captured by three properties:
The pages linked from the list below show several XML documents with different kind of validation results:
  1. a fully validated, valid document (this one and the next two are transcriptions of a short poem by Ogden Nash)
  2. a fully validated, partially valid document (all the sub-elements of poem are valid, but they occur in the wrong order, so poem itself is invalid)
  3. a partially validated, mostly valid document (the sub-elements inside author are not declared, so they couldn't be validated, but the poem element itself is OK, because it has all the right children in the right order)
  4. another partially validated, partially valid document with different errors in different parts of the document (this one is a version of the purchase-order example in the XML Schema tutorial)
[P.S. 3 February 2004: The stylesheet and shell scripts I use to generate these results are now linked from my People page.]

Thanks to Michael Hahn (Document Management Solutions, Inc.) for suggesting the Ogden Nash poem as a useful example. Thanks to the XML 2003 poster chair Kate Hamilton of Mulberry Technologies for encouragement and advice.
$Id: poster1.html,v 1.1 2004/02/03 16:39:27 cmsmcq Exp $