Architecting and designing
  
XSD overview
System Architect provides you with an option to reverse or generate XML Schema using UML Class models that are associated with XSD schema package.
The following tables describe the XSD elements that are supported in System Architect.
XSDschema
UML construct
Package; component
Description
All classes in a package or component are defined in one schema. This stereotype can be used to specify schema-wide settings.
 
 
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
xmlns:
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 used to generate complexType definitions.
schemaLoc:
The URI which identifies the location of the schema.
targetNamespace:
The URI which uniquely identifies this schema’s namespace.
schemaNamespPrefix:
The prefix which abbreviates the targetNamespace.
version:
The version of this schema.
encoding
Schema encoding.
blockDefault
Specifies the default value of the block attribute on element and complexType elements in the target namespace.
finalDefault
Specifies the default value of the final attribute on element, simpleType, and complexType elements in the target namespace.
XSDcomplexType
UML construct
Class
Description
complexType definitions are created for generic UML classes. This stereotypes helps tailor the generation of a complexType definition.
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. Refer to the W3C XML Schema recommendation.
modelGroup:
( all | sequence | choice )
Overrides the default XSD model for generating this complexType definition.
maxOccurs
Specifies the maximum number of times the group element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1.
minOccurs
Specifies the minimum number of times the group element can occur in the parent element. The value can be any number >= 0. Default value is 1.
If the modelGroup is "sequence", "Position" property of the class attributes will be populated as the order of the child elements of "sequence" is important.
If the modelGroup is "choice", "Position" property of the Class Attribute will be populated with a value of "1" for all of the child elements of "choice".
If an element child of the complex type has a type other than a basic type (that is, preloaded in the XSD Types package), and the type is defined in the XSD file, an association will be created to reflect that relationship. Multiplicity will be based upon minOccurs and maxOccurs attribute values of the element.
If an element child of the complex type does not have a type and a name but instead has a "ref" attribute pointing to a top level class or a complex or simple type, an Association will be created to reflect that relationship and the name of the "to" Association End will be the name of the referenced class. Multiplicity will be based upon minOccurs and maxOccurs attribute values of the element.
The Class Attributes created from the elements included in the complex type can have a stereotype of "XSDelement" or a stereotype of "XSDattribute" depending upon the kind of element that was used in the XSD file.
If "anyAttribute" element was used, a Class Attribute called "anyAttribute" will be created with a stereotype of "XSDany".
XSDsimpleType
UML Construct
Class
Description
A Class definition will be created with a "Stereotype" of "XSDsimpleType".
 
 
Tagged values
 
derivation:
Specifies the derivation of the simpleType. Refer to the W3C XML Schema recommendation.
length:
Refer to the W3C XML Schema recommendation.
minLength:
Refer to the W3C XML Schema recommendation.
maxLength:
Refer to the W3C XML Schema recommendation.
pattern:
Refer to the W3C XML Schema recommendation.
 
 
Constraints
This class can only participate in an inheritance relation with another simpleType. It cannot have any attributes or own any associations. They will be ignored if present.
 
Most property names are attribute and restriction names. If we encounter the "extension" or "restriction" restrictions, we will create "Is Subclass" definitions and base classes defined by the "base" attribute, and draw the lines between the simple type class and the base class. The "Is Subclass" "Stereotype" property will be set to either XSDrestriction or XSDextension.
XSDany
UML construct
Class
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.
 
 
Tagged Values
 
namespace:
Refer to the W3C XML Schema recommendation.
processContents:
( skip | lax | strict )
Refer to the W3C XML Schema recommendation.
 
 
Constraints
None.
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 will be the children of this model group when added to that complexType.
 
 
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
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.
XSDgroup
Description
If the "group" element is present, we will create a new Class with a "Stereotype" of XSDgroup and based upon whether or not the element is the child of the "schema" element, or not we will create an Association.
Tagged values
None.
If a "documentation" element is encountered, the "Description" property of the System Architect object will be populated.
XSDelement
UML construct
Attribute; AssociationEnd
Description
By applying this stereotype to a UML class attribute or AssociationEnd, the corresponding UML entity is generated as an element in the parent complexType and not as an XSD attribute.
 
 
Tagged Values
 
form:
(qualified | unqualified)
Overrides the schema’s elementFormDefault value.
position:
Causes the elements to be ordered in 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.
 
 
Constraints
None.
XSDattribute
UML construct
Attribute; associationend
Description
By applying this stereotype to a UML class attribute or AssociationEnd, the corresponding UML entity is generated as an XSD attribute in the parent complexType and not as an XSD element.
 
 
Tagged Values
 
form:
( qualified | unqualified )
Overrides the schema’s attributeFormDefault value.
use:
( prohibited | optional | required )
Refer to the W3C XML Schema recommendation.
default:
Refer to the W3C XML Schema recommendation.
fixed:
Refer to the W3C XML Schema recommendation.
 
 
Constraints
The attribute datatype should not refer to a class specification, it will be ignored otherwise.
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.