HOPEX UML : HOPEX XML Schemas : XSD Generation : XSD Generation: Namespaces and Schemas
   
XSD Generation: Namespaces and Schemas
 
Generating the namespace
Other packages
XSD Generation: The schema Class
Using Elements External to the Schema
Generating the namespace
A namespace is represented by a package of the "XML Document Definition" stereotype. Packages of this type contain one or more classes of the "XML Document Definition Root" stereotype, and a certain number of classes defining the elements that form the vocabulary of the namespace.
The "XDD urn" generation parameter for the package corresponds to the identifier for the namespace (urn).
*It is very important that in the hierarchy of packages that own a class, only one package has the XML Document Definition stereotype. In other words, a namespace cannot own another namespace or be owned by another namespace.
Other packages
You can use packages not interpreted as namespaces for organizational purposes. You can group packages representing namespaces in one or more packages that are not of the "XML Document Definition" stereotype. Similarly, classes defining the vocabulary can be "stored" in packages included in the "namespace" package.
XSD Generation: The schema Class
The schemas are represented by classes of the "XML Document Definition Root" stereotype.
The vocabulary contained in the schema is connected to the schema class by the "XML Document Definition Tag" leg, to allow partitioning the namespace. If tag definitions are contained in the "namespace" package without being connected to a schema class, the tag definitions appear in each schema in the namespace.
The root class also serves as a point of departure for declaring global attributes or elements (associated with the attributes of UML classes and roles of UML classes respectively).
You can configure a schema class in the XSD tab of its Properties dialog box:
XSD Name: name of the schema class in the context of XSD generation. The name of the generated file containing the schema is calculated from the name of the schema class (or the "XSD Name" parameter if it is present).
XSD AttributeFormDefault: corresponds to the "attributeFormDefault" attribute.
XSD BlockExtension, XSD BlockRestriction, and XSD BlockSubstitution: used to define the values of the "blockDefault" attribute. The value of the "blockDefault" attribute is a combination of the "extension", "restriction", and "substitution" values.
XSD ElementFormDefault: corresponds to the "elementFormDefault" attribute.
XSD FinalExtension and XSD FinalRestriction: allow defining the values of the "finalDefault" attribute. The value of the "finalDefault" attribute is a combination of the "extension" and "restriction" values.
XSD id: value of the "id" attribute.
XSD version: corresponds to the "version" attribute.
XSD xml:lang: corresponds to the "xml:lang" attribute.
specificationLocation: indicates the location of the schema. It is primarily used for imports and includes.
In the Alias tab, you can connect a namespace to the schema class. See "Import and Inclusion of Other Schemas".
Using Elements External to the Schema
You can use elements external to the schema.
These elements are:
Global elements
Global attributes
"attributeGroups" (definitions of attribute groups)
Groups of elements (definitions of model groups)
Simple and complex types
You can also declare other schemas and namespaces that have vocabulary you want to use. See "Import and Inclusion of Other Schemas".