The XML Schema to UML transformation helps extract the abstract UML model from the XML schema model.

Type mapping

Type maps store mapping between primitive UML data types and primitive XML Schema data types. The same applies for UML to XML Schema Transformation in reverse as well. For XML Schema to UML element type mapping diagram, see Type mapping.

Transformation results

Once the XML schema has been transformed to UML models, you will see the following:

  • The XML Schema diagrams are transformed to the Class diagrams. Unnecessary stereotypes (XSDxxxx) are discarded from the classes.
  • Attributes of the classes are gathered if they were spread into several different classes.
  • Attributes of the classes may be realized as associations. In this case the main class gathers all the associations of the members.
  • The same principle is applied when elements are in a group shared by two or more classes. Elements (attributes) are copied into both destination classes.
  • The attributes with the «XSDgroupRef» stereotype are treated as if the group relationship has been drawn and transformed accordingly. They are discarded in the UML model, and the group content (elements / attributes) placed in their place.
  • Simple XML schema types (classes with the «XSDsimpleType» stereotype), which after copying and type remap are derived from any data type (UML DataType), or not derived from anything and are transformed into the UML data types.
  • Simple XML schema types derived by restriction from a string, restricted by enumerating string values, and are converted into enumerations in the UML diagrams.
  • The classes with the «XSDschema» stereotype are not copied into a destination model.
  • The «XDSkey», «XSDkeyref», and «XSDunique» stereotyped attributes are not copied into a destination model.
  • The «XDSany», «XSDanyAttribute» stereotyped attributes are not copied into a destination model. The «XDSnotation» stereotyped attributes are not copied into a destination model.
  • The «XDSlength», «XDSminLength», «XDSmaxLength», «XSDpattern», «XSDfractionDigits», «XSDtotalDigits», «XDSmaxExclusive», «XDSmaxInclusive», «XDSminExclusive», and «XDSminInclusive» stereotyped attributes are not copied into a destination model.
  • The XML schemas (classes with the «XSDschema» stereotype) should not be transformed, but they may contain inner classes (anonymous types of schema elements). These inner classes are transformed using the usual rules for UML type transformation, as if they were not inner classes but normal XML schema types.