Stylus Studio XML Editor

Table of contents

Appendices

4.1 Layer 1: Summary of the Schema-validity Assessment Core

Layer 1: Summary of the Schema-validity Assessment Core

The fundamental purpose of the assessment core is to define assessment for a single element information item and its descendants with respect to a complex type definition. All processors are required to implement this core predicate in a manner which conforms exactly to this specification.

assessment is defined with reference to an XML Schema (note not a schema document) which consists of (at a minimum) the set of schema components (definitions and declarations) required for that assessment. This is not a circular definition, but rather a post facto observation: no element information item can be fully assessed unless all the components required by any aspect of its (potentially recursive) assessment are present in the schema.

As specified above, each schema component is associated directly or indirectly with a target namespace, or explicitly with no namespace. In the case of multi-namespace documents, components for more than one target namespace will co-exist in a schema.

Processors have the option to assemble (and perhaps to optimize or pre-compile) the entire schema prior to the start of an assessment episode, or to gather the schema lazily as individual components are required. In all cases it is required that:

  • The processor succeed in locating the schema component transitively required to complete an assessment (note that components derived from schema document can be integrated with components obtained through other means);

  • no definition or declaration changes once it has been established;

  • if the processor chooses to acquire declarations and definitions dynamically, that there be no side effects of such dynamic acquisition that would cause the results of assessment to differ from that which would have been obtained from the same schema components acquired in bulk.

NOTE: 

the assessment core is defined in terms of schema components at the abstract level, and no mention is made of the schema definition syntax (i.e. [schema]). Although many processors will acquire schemas in this format, others may operate on compiled representations, on a programmatic representation as exposed in some programming language, etc.

The obligation of a schema-aware processor as far as the assessment core is concerned is to implement one or more of the options for assessment given below in [Assessing Schema-Validity]. Neither the choice of element information item for that assessment, nor which of the means of initiating assessment are used, is within the scope of this specification.

Although assessment is defined recursively, it is also intended to be implementable in streaming processors. Such processors may choose to incrementally assemble the schema during processing in response, for example, to encountering new namespaces. The implication of the invariants expressed above is that such incremental assembly must result in an assessment outcome that is the same as would be given if assessment was undertaken again with the final, fully assembled schema.