HOPEX UML : HOPEX XML Schemas : Controls : Checking XML Schemas
   
Checking XML Schemas
 
Checking Associations
Checking Association Roles
Checking Classes
Checking Attributes
Checks are run by object type. This level of checking indicates problems found in the schema modeling.
Checking Associations
An association must be binary.
The control module signals all non-binary associations (ternary, etc.).
The role opposite an aggregation must be navigable.
If elements are described by a binary association in which one role is an aggregation, the opposite role must be navigable (isNavigable set to Yes or not specified)
Checking Association Roles
An association role of a primitive type must be named.
When an association role is not named, it automatically assumes the name of the class to which it is attached. For primitive types (NMTOKENS, STRING), the name of the role must be specified in order to avoid generating elements with reserved names.
Checking Classes
A group can only inherit groups
A class of the Schema Group stereotype can only inherit classes of the same stereotype. In this case, inheritance of classes of the Enumeration or Interface stereotype is prohibited.
A class without a stereotype cannot inherit groups
A class that is not of the Schema Group stereotype cannot inherit groups. However, the standard UML stereotypes such as Boundary, Entity, etc. are not checked as they should not appear in a schema (unless the data model and the document structure are modeled by the same classes).
A class can have only one attribute of type ID.
An XML tag can only have one XML attribute of type ID.
The constraint in MEGA therefore concerns classes that model these tags.
A class must have at most one attribute of type ID.
However, this constraint is made more complex by the automatic creation mode applied to attributes of this type. Attributes inherited by a class that have not been overloaded must also be taken into account.
This check will indicate all attributes of type ID, as well as the attribute created automatically when the corresponding option is selected (XDD compulsory ID Attribute parameter).
Checking Attributes
Non-optional attributes should not have an initial value
Required attributes (multiplicity of 1 or unspecified) cannot have an initial value because they must always be specified.
The cardinality of an attribute cannot be greater than 1
In the XML language, a tag cannot declare an attribute more than once. Its multiplicity in MEGA will therefore be at most 1. The authorized values are: unspecified, 0, 0.0.1 and 1.