Validation Mode

XML is known as a semi-structured data format because it accommodates both valid and well-formed data. Valid data corresponds to a given schema (or DTD). Well-formed data is syntactically correct (all open tags have matching end tags), but is otherwise unconstrained.

XML Schema provides three modes of validation, to allow mixing of valid and well-formed data.

  1. strict requires that a declaration be available for the element, and the element must validate with respect to that declaration. The element is labeled with the declared type, as are all elements and attributes within the element.

  2. skip has no constraints; the element must simply be well formed. The element and all elements within it are labeled with type xs: anyType, and all ...

Get XQuery from the Experts: A Guide to the W3C XML Query Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.