Stylus Studio XML Editor

Table of contents

Appendices

2.3 Constraints and Validation Rules

Constraints and Validation Rules

The [ref-xml] specification describes two kinds of constraints on XML documents: well-formedness and validity constraints. Informally, the well-formedness constraints are those imposed by the definition of XML itself (such as the rules for the use of the < and > characters and the rules for proper nesting of elements), while validity constraints are the further constraints on document structure provided by a particular DTD.

The preceding section focused on valid, that is the constraints on information items which schema components supply. In fact however this specification provides four different kinds of normative statements about schema components, their representations in XML and their contribution to the valid of information items:

Schema Component Constraint

Constraints on the schema components themselves, i.e. conditions components must satisfy to be components at all. Located in the sixth sub-section of the per-component sections of [Schema Component Details] and tabulated in [Schema Component Constraints].

Schema Representation Constraint

Constraints on the representation of schema components in XML beyond those which are expressed in [Schema for Schemas (normative)]. Located in the third sub-section of the per-component sections of [Schema Component Details] and tabulated in [Schema Representation Constraints].

Validation Rules

Contributions to valid associated with schema components. Located in the fourth sub-section of the per-component sections of [Schema Component Details] and tabulated in [Validation Rules].

Schema Information Set Contribution

Augmentations to post-schema-validation infosets expressed by schema components, which follow as a consequence of valid and/or assessment. Located in the fifth sub-section of the per-component sections of [Schema Component Details] and tabulated in [Contributions to the post-schema-validation infoset].

The last of these, schema information set contributions, are not as new as they might at first seem. XML 1.0 validation augments the XML 1.0 information set in similar ways, for example by providing values for attributes not present in instances, and by implicitly exploiting type information for normalization or access. (As an example of the latter case, consider the effect of NMTOKENS on attribute white space, and the semantics of ID and IDREF.) By including schema information set contributions, this specification makes explicit some features that XML 1.0 left implicit.