XML Schema to UML Mapping

Once an XML Schema is submitted for registration it has to be converted to XMI so that it can be imported into the registry. This is done using a metadata import tool. The tool imports existing electronic metadata and allows the specification of required registry meta-attributes that are not likely to exist in the original metadata.

The metadata import tool is based on Eclipse EMF and XSD plug-ins, v2.X. The XML Schema-to-UML mapping is, where possible, similar to the inverse of the OMG XMI standard (which defines a MOF to XML Schema mapping, and can be used for UML to XML Schema mapping).

The import tool maps the XML Schema to EMF's Ecore language which is then mapped to UML. As a result of the XML Schema to EMF Ecore mapping new constructs emerge within the model. The following highlights some of the changes that may occur as part of the XML Schema to Ecore mapping. For more information on EMF mapping, see 'XML Schema to Ecore Mapping' at:

http://www.eclipse.org/emf/docs/overviews/XMLSchemaToEcoreMapping.pdf


  1. If there is one or more global element or attribute declaration in the schema, then a Class, representing the document root, is created in the schema's Package. The name of the document root class is "DocumentRoot". A document root class will contain one feature (either an attribute or a reference) for every global attribute or element declaration in the schema. A single instance of this class is used as the root object of an XML resource (that is, a conforming XML document).
  2. For an XML Schema complex type, if the base type of an extension or restriction is a simple type, a single Attribute with the name 'value' is added to the list of Attributes for the generated class. The Type of this Attribute will be the DataType corresponding to the base of the simple context extension.
  3. In some situations, the XML Schema mapping might result in elements with conflicting names (for example, two Attributes that are in the same Class and have the same name). In such situations, the second and subsequent elements will be made unique by appending a number to the end of their names (for example, "foo1").
  4. If an XML Schema complex type is mixed - this is represented in the exported UML model by a tagged value.
  5. xsd:choice is taken into account via ExtendedMetadata stored in the Ecore model and is represented in the exported UML model by the addition of classes, associations and generalisations.
  6. xsd:restriction is taken into account via ExtendedMetadata stored in the Ecore model and is represented in the exported UML model by the addition of a dependency between the client and the supplier classes with a 'Restriction' stereotype.

Back to Submit XML Schema ...

Highways Agency