Associating a Schema to XML Documents
To provide as-you-type validation and to compute valid proposals for the Content Completion Assistant, Oxygen XML Editor requires a schema to be associated with the XML document. The schema specifies how the internal structure of the XML is defined.
Supported Types of Schema
The following schema types are supported:
- W3C XML Schema 1.0 and 1.1 (with and without embedded Schematron rules) - The
association with an XML Schema is added as an attribute of the root element with one of
the following:
@xsi:schemaLocation
attribute, if the root element of the document is in the namespace.@xsi:noNamespaceSchemaLocation
attribute, if the root element is not in the namespace.
- DTD - The association with a DTD is added as a
DOCTYPE
declaration. - Relax NG - XML Syntax (with and without embedded Schematron rules) - The association is added as an xml-model processing instruction.
- Relax NG - Compact Syntax - The association is added as an xml-model processing instruction.
- NVDL - The association is added as an xml-model processing instruction.
- Schematron (both ISO Schematron and Schematron 1.5) - The association is added as an xml-model processing instruction.
Detecting the Schema(s) for Validation
For validation, Oxygen XML Editor tries to detect one or more schemas by searching
multiple locations, in the following order:
- The schema or multiple schemas referenced in validation stages from the validation scenario(s) associated with the current XML document.
- If no validation scenario is selected to be used with the current XML document, then it falls back to the schema or multiple schemas defined in validation stages from the validation scenarios specified as default in the particular document type configuration.
- If a schema is still not detected, then it falls back to the schema or multiple
schemas associated directly in the XML document.Tip: To quickly open the schema used for validating the current document, select the Open Associated Schema action from the toolbar (or menu).
- If a schema is still not detected, then it falls back to the schema defined in the Schema tab of a framework (document type) configuration.
Detecting a Schema for Content Completion
For content completion, Oxygen XML Editor uses just one schema and tries to detect
that schema by searching multiple locations, in the following order:
- If no schema is detected in the document, then it falls back to the highest ranking schema defined in validation stages from the validation scenario(s) associated with the current document.
- If a schema is still not detecting, then it falls back to the highest ranking schema defined in validation stages from validation scenarios specified as default in the particular document type configuration.
- Oxygen XML Editor determines the most appropriate or highest ranking schema that is associated directly in the XML document and uses it for content completion.
- If a schema is still not detecting, then it falls back to the schema defined in the Schema tab of a framework (document type) configuration.