HOPEX UML : HOPEX XML Schemas : XSD Reverse Generation : Modeling the XSD Schema tags : XSD reverse generation: Unique - Key - KeyRef
   
XSD reverse generation: Unique - Key - KeyRef
Unique
The "Unique" tag defines a uniqueness constraint on an element. The uniqueness constraint generally applies to the value of an attribute or to the text contained in a tag.
Unique: modeled by a constraint of the "XSD Uniqueness" stereotype, and by a constraint type that is set to "unique". This constraint is connected to the class role (element) to be constrained.
Attributes of "Unique"
Id: this attribute is not modeled.
Name: modeled by the name of the constraint.
Selector - Field
The "Selector" tag defines the path for accessing the constrained fields.
"Field" defines the constrained attributes or elements. These attributes or elements are accessed by following the path defined by "Selector".
These tags are modeled by the XSD Constraint text field for the constraint.
Annotation
Refer to "XSD reverse generation: Annotation (Documentation - AppInfo)".
Key Definition
The "Key" tag defines a uniqueness constraint on an element. It has the same role as "Unique", but in addition, you can reference it as a foreign key. The uniqueness constraint generally applies to the value of an attribute or to the text contained in a tag.
"Key" is modeled by a constraint of the "XSD Key" stereotype. The constraint has no associated type. This constraint is connected to the class role (element) to be constrained.
Attributes of "Key"
Id: this attribute is not modeled.
Name: modeled by the name of the constraint.
Selector - Field
These tags are modeled by the "XSD Constraint" text field of the constraint.
KeyRef Definition
The "KeyRef" tag defines a constraint on an element that takes its values from elements subject to another "Key" constraint.
"KeyRef" is modeled by a constraint of the "XSD KeyReference" stereotype. The constraint has no associated type. This constraint is connected to the class role (element) to be constrained.
Attributes of "Keyref"
Id: this attribute is not modeled.
Name: modeled by the name of the constraint.
Refer: modeled by the "Constraint" link between the referencing constraint and the referenced constraint.
Selector - Field
These tags are modeled by the "XSD Constraint" text field of the constraint.