Restrictions in the current implementation ========================================== Order of items in the schema document: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. All global elements and attributes must be defined before they are referenced in a complexType definition using "ref=...". 2. All element groups and attribute groups must be defined before they are referenced in a complex or simple type definition using "") to indicate the end of the element's start tag, * element(s) for the base class, * element(s) for the derived class. 2. Since Demeter only allows for **abstract** superclasses, inheritance relationships involving concrete superclasses are not preserved in the resultant CD. However, the "common" parts in the base class are duplicated in the "derived" class, as in the case of abstract "base" types. 3. Since XML schema does not allow simpleType definitions to be declared "abstract", simple type derivations in schema definitions are not mapped to inheritance relationships in the CD, because Demeter does not allow concrete superclasses. In the CD, the derived type is represented as having the same part as the class corresponding to the "base" type, with the necessary restrictions added to represent any constraining facet. Validation of XML schemas: ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. The application assumes that input schema documents are valid according to current specifications, and does not expect invalid constructs. It may also accept some schema documents that are not valid but satisfy an extended grammar - this has been done to simplify the class-dictionary used in the adaptive program. Checking the validity of schemas is considered to be out of scope of this application. Syntax in the instance documents: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. For the root element in an XML instance document, all the namespace prefix attributes (the ones with "xmlns" as a namespace-prefix, e.g. xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance") must be specified first, followed by the schema-location attribute (one of "schemaLocation" or "noNamespaceSchemaLocation"), followed by the declared attributes of the root element itself. Of course, the namespace prefix attributes and the schema-location attribute are all optional. However, if a namespace prefix is used anywhere in the instance document (e.g. to spcify the concrete type of an element using "xsi:type"), then the namespace-prefix must be declared here. Namespace-prefix definitions are not allowed to be defined in any element other than the root. 2. For any element in an XML instance document, the "xsi:type" attribute, whenever present, must be the **last** attribute (except for the ignored "xsi:nil" attribute) for the element.