Profile for XML Schema

The UML Profile for XSD specifies stereotypes that provide an explicit mapping from XSD to UML constructs. The Tagged Values further define aspects of the mapping, such as whether the elements should be qualified. The constraints define any conditions that must be satisfied for the stereotype to apply.

The UML Profile for XSD specifies the following stereotypes:

 

The following tables list the features of the UML Profile for XSD.

  • Tagged Value names are shown in bold followed by the allowed values.
  • If a default value is used by Enterprise Architect's schema generator, it is underlined.

«XSDschema»:

UML Construct

 

Package

Description

 

All Classes in a package are defined within one schema. This stereotype can be used to specify schema-wide settings.

Toolbox Icon

 

Schema_Icon

Tagged Values

anonymousRole
(true | false)

Specifies if the role name is included in the element declaration for the UML attribute.

 

anonymousType
(true | false)

Specifies whether the Class type is anonymous for attributes.

 

attributeFormDefault
(qualified | unqualified)

Determines whether attribute instances must be qualified.

 

defaultNamespace

The default namespace used in this schema. This value is used to specify the default namespace attribute (xmlns=), in the schema element.

 

elementDerivation
(true | false)

Determines whether inheritances are generated using XSD extension or copy-down inheritance.

 

elementFormDefault
(qualified | unqualified)

Determines whether element instances must be qualified.

 

memberNames
(qualified | unqualified)

Determines whether elements generated from Class attributes have their name qualified by the corresponding Class name.

 

modelGroup
(all | sequence | choice)

Specifies the default XSD model group used to generate complexType definitions.

 

schemaLocation

The URI that identifies the location of the schema. This value is used in the import and include elements.

 

targetNamespace

The URI that uniquely identifies this schema's namespace.

 

targetNamespacePrefix

The prefix that abbreviates the targetNamespace.

 

version

The version of this schema.

 

xmlns

The comma separated list of all the namespaces ( and their prefixes ).

Constraints

 

None.

«XSDcomplexType»:

UML Construct

 

Class

Description

 

complexType definitions are created for generic UML Classes. This stereotypes helps tailor the generation of a complexType definition.

Toolbox Icon

 

ComplexType_Icon

Tagged Values

memberNames
(qualified | unqualified)

Determines whether elements generated from the UML Class attributes and associations have their name qualified by the corresponding Class name for this complexType definition.

 

mixed
(true | false)

Determines whether this element can contain mixed element and character content. See the W3CXML Schema recommendation.

 

modelGroup
(all | sequence | choice)

Overrides the default XSD model for generating this complexType definition.

 

minOccurs

Specifies the minimum number of times the model group in the element can occur.

 

maxOccurs

Specifies the maximum number of times the model group in the element can occur.

 

nillable
(true | false)

Specifies whether a null value can be assigned to the top-level element generated for this complexType element.

Constraints

 

None.

«XSDsimpleType»

UML Construct

 

Class

Description

 

An XSD simpleType is generated for Classes with this stereotype.

Toolbox Icon

 

SimpleType_Icon

Tagged Values

derivation:
(restriction | list)

Specifies the derivation of the simpleType. See the W3C XML Schema recommendation.

 

length:

 

 

 

 

 

See the W3C XML Schema recommendation.

 

minLength:

 

maxLength:

 

minInclusive:

 

minExclusive:

 

maxInclusive:

 

maxExclusive:

 

totalDigits:

 

fractionDigits:

 

whiteSpace:

 

pattern:

Constraints

 

This Class can only participate in an inheritance relation with another simpleType. It cannot have any attributes or own any associations; they are ignored if present.

«XSDsequence»

UML Construct

 

Class

Description

 

The schema generator creates a sequence model group as the container for the attributes and associations owned by this Class. The model group is in turn added to the model groups of this Class respective owners.

Tagged values specified by owners of this Class persist through to the child elements of this model group. Thus if memberNames are unqualified for a complexType, so are the children of this model group when added to that complexType.

Toolbox Icon

 

ModelGroup_Icon

Tagged Values

 

None.

Constraints

 

This Class must be the destination of unidirectional associations. If it is not, this Class and its connectors are ignored, possibly invalidating other model group Classes.

Inheritance relations are ignored for this Class.

«XSDchoice»

UML Construct

 

Class

Description

 

Creates an XSD choice element. See XSDsequence for more details.

Toolbox Icon

 

ModelGroup_Icon

Tagged Values

 

None.

Constraints

 

As for XSDsequence.

«XSDelement»

UML Construct

 

UML Attribute, Association End

Description

 

By applying this stereotype to a UML Class or Association End, the corresponding UML entity is generated as an element within the parent complexType and not as an XSD attribute.

Toolbox Icon

 

Element_Icon

Tagged Values

form:
(qualified | unqualified)

Overrides the schema's elementFormDefault value.

 

position:

Causes the elements to be ordered within a sequence model group of the containing complexType. Duplicated and invalid position Tagged Values are ignored and result in undefined ordering of the UML attributes. Missing position values cause the defined positions to be allocated as specified, with the remaining elements filling the missing positions in an undefined order.

 

anonymousRole:
(true | false)

Specifies if the role name is included in the element declaration for the UML attribute.

 

anonymousType:
(true | false)

Specifies whether the Class type is anonymous for attributes.

 

nillable
(true | false)

Specifies whether a null value can be assigned to this element.

 

default

 
See the W3C XML Schema recommendation.

 

fixed

Constraints

 

None.

«XSDattribute»

UML Construct

 

UML Attribute, Association End

Description

 

By applying this stereotype to a UML Class attribute or Association End, the corresponding UML entity is generated as an XSD attribute within the parent complexType and not as an XSD element.

Toolbox Icon

 

Attribute_Icon

Tagged Values

form:
(qualified | unqualified)

Overrides the schema's attributeFormDefault value.

 

use:
(prohibited | optional | required)

 

See the W3C XML Schema recommendation.

 

default

 

fixed

Constraints

 

The attribute datatype should not see a Class specification, otherwise it is ignored.

«XSDany»

UML Construct

 

UML Attribute

Description

 

If applied to a UML attribute, an XSD anyAttribute element is generated. If applied to a UML Class, an XSD any element is generated.

Toolbox Icon

 

AnyAttribute_Icon

Tagged Values

namespace:

 

See the W3C XML Schema recommendation.

 

processContents:
(skip | lax | strict)

Constraints

 

None.

«XSDrestriction»

UML Construct

 

Generalization

Description

 

Overrides the default use of XSD extension for inheritance and generates the child as a complexType with a restriction element instead.

Tagged Values

 

None.

Constraints

 

Applies only to UML Class parent-child relations.

«XSDgroup»

UML Construct

 

Class

Description

 

An XSDgroup is generated for Classes with this stereotype.

Toolbox Icon

 

ModelGroup_Icon

Tagged Values

modelGroup:
(sequence | choice | all)

Overrides the default XSD model for generating this group definition.

Constraints

 

A group Class can only associate itself to other group Classes.

A group Class can be associated by another group Class or a complexType Class.

The association should be via an Association connector.

A group Class cannot be inherited/aggregated.

«XSDtopLevelElement»

UML Construct

 

Class

Description

 

Creates an <xs:element> construct which acts as a container for XSDcomplexType and XSDsimpleType Class.

Toolbox Icon

 

Element_Icon

Tagged Values

default

 
See the W3C XML Schema recommendation.

 

fixed

Constraints

 

An XSDtopLevelElement Class can contain either an XSDsimpleType or an XSDcomplexType as its child Class. When such a Class is present as its child, all its inheritance is ignored.

This Class cannot be inherited.

«XSDtopLevelAttribute»

UML Construct

 

Class

Description

 

Creates an <xs:attributr> construct which acts as a container for XSDsimpleType Class.

Toolbox Icon

 

Attribute_Icon

Tagged Values

use:
(optional | required | prohibited)

 

See the W3C XML Schema recommendation.

 

default

 

fixed

Constraints

 

An XSDtopLevelAttribute Class can contain only an XSDsimpleType Class as its child Class. When such a Class is present as its child, all its inheritance is ignored.

This Class can inherit from only one XSDsimpleType Class.

«XSDunion»

UML Construct

 

Class

Description

 

Creates an <xs:union> construct which can act as a container for XSDsimpleType Class.

Toolbox Icon

 

Union_Icon

Tagged Values

 

None

Constraints

 

An XSDunion Class can contain only XSDsimpleType as its child Class and can generalize from other XSDsimpleType Classes only.

All the Classes that this Class generalizes become the members of the attribute memberTypes.

This Class cannot have any attributes or associations.

«XSDattributeGroup»

UML Construct

 

Class

Description

 

Creates an <XSDattributeGroup> construct which can act as a container for a set of elements for stereotype XSDattribute.

Toolbox Icon

 

AttributeGroup_Icon

Tagged Values

 

None

Constraints

 

An XSDattributeGroup Class can contain only elements of stereotype XSDattribute and can be associated only with other XSDattributeGroup Classes.

Only XSDcomplexType Classes can associate with this Class.

This Class cannot be inherited.

Learn More: