HOPEX UML : HOPEX XML Schemas : Presentation of the Schema Editor : Definitions
   
Definitions
 
Defining a Tag
Element
Attribute
Namespace
Defining a Tag
Tag definition is the concept that identifies the names of its attributes, the multiplicity of its attributes, and sub-tags contained in the tag. This concept defines a family of tags (we will use UML classes to define tags). Instances of these tags are found in XML documents. Tag definition should be distinguished from tag.
A tag definition is characterized by:
the list of tag attributes.
The sub-tags potentially nested within the tag, becoming part of its definition.
Information describing the order of these sub-tags, how often they appear, etc.
Tag definition example
<xsd:ComplexType name="Person">
<xsd:sequence>
<element name="Address_Person" type="Address_Person"/>
</xsd:sequence>
<xsd :attribute name="Name" Type="xsd:string"/>
<xsd :attribute name="Name" Type="xsd:string"/>
</xsd:complexType>
Tag instance example
<Person name="Smith" first name="Peter>
<Address_Person">
12 rue Cabanis
</Address_Person>
</Person>
Here are the two possible representations of this tag definition in HOPEX:
 
Diagram
Diagrams
 
 
 
UML modeling
A UML class represents a family of XML tags, not a specific tag in a document
*Through associations, you can reuse a tag definition to define several tags that have the same characteristics in a document. For example, the <WorkAddress> and <HomeAddress> tags can use the same <Address> definition.
 
Element
An element represents a tag in the schema editor The XML elements of a tag A are defined by the set of tags potentially included in A.
UML modeling
When creating an element, a hierarchical relation appears between the tag definitions, which is why associations between classes are a natural representation.
When you create an element, HOPEX automatically creates the association between the class declaring the element and the element type.
This means the element is composed of the class + association.
Example
If the "Person" tag definition includes tags based on the "Address_Person" tag definition, the classes "Person" and "Address_Person" defining these tags will be linked by an association.
Properties of the element
To display the properties of the element, right-click the element and select:
Type properties to display the properties of the class defining the element.
Role properties to display the properties of the association role corresponding to the element.
*When the editor is in "standard level" mode, the pop-up menu presents only the properties of the role. See "Schema Editor Display Parameters".
Attribute
The XML attributes of a tag are pairs of strings in the format name-value. The second string is contained within quotes. XML attributes serve to characterize the tag. Example: <person name= ’Smith’/>.
Namespace
The namespace is a set of predefined terms (set of tag definitions, elements and attributes of a document). Inside this space, two tags are not allowed to have the same name.
*See "Accessing Namespace Types".