Profile Structure

Return to Introduction  Previous page  Next page

UML Profiles for Enterprise Architect are distributed in XML format. The file has the following format:

General Header Details

<?xml version="1.0" encoding="utf-8" ?>

<UMLProfile profiletype="uml2">

<!--Profile name, version number and general notes -->

<Documentation id="XSDSchema" name="UML Profile for XSD Schema" version="1.0" notes="Defines a set of stereotypes and tagged values for XSD Schemas"/>

<!-- The profile content -->

<Content>

<!-- List of stereotypes used in this profile. Can also include tagged values, constraints, metafile and descriptive comments-->

   <Stereotypes>

Stereotype Definitions

The header is followed by one or more Stereotype definitions; for example:

<!-- <<XSDComplexType>> -->

<Stereotype name="XSDComplexType" notes="ComplexType definition generated in XML Schema">

<AppliesTo>

   <Apply type="class"/>

</AppliesTo>

<TaggedValues>

   <Tag name="mixed" description="URI to unique target namespace"/>

   <Tag name="modelGroup" description="Default model group used when generating complexType definitions for this Schema" values="all | sequence | choice" default="choice"/>

   <Tag name="attributeMapping" description="Default for generating UML attributes as elements, attributes or both within complexTypes" values="element | attribute| both" default="both"/>

   <Tag name="roleMapping" description="Prefix associated with namespace"/>

   <Tag name="memberNames" description="Schema version"/>

</TaggedValues>

 

<Constraints>

   <Constraint name="" type="" notes=""/>

</Constraints>

</Stereotype>

Note the specification of Stereotype name and notes. Also note the use of Tagged Values to set properties for the Profile element. The Tagged Values can have a default value, can be empty and can specify enableable values. Tagged Values are edited in the Properties window of an element, method, attribute or link.

You can also specify the default size, default comment and Metafile for drawing an element; see the fragment below:

<Stereotype name="Router" cx="130" cy="100" notes="" metafile="router.emf">

In the above example, the metafile shape for this element is specified as 'router.emf'; when you load this Profile, the .emf file must be in the same directory as the Profile, otherwise the load fails.

Also note how to specify a default comment for an element. All white space between lines is ignored. To force a line break, use the \n character. To force tabs, use \t.

<Comment>

  Some text here about how this works\n\t

  with comments being imported from the XML description 

  in one long row.

</Comment>

The example above would import like this:

Some text here about how this works

   with comments being imported from the XML description in one long row.