- XML schema attribute maps to UML Attribute with stereotype XSDattribute.
- default maps to initial UML Attribute or AssociationEnd value.
- annotation – to UML Attribute or AssociationEnd documentation.
- name – to UML Attribute or AssociationEnd name.
- type or content simpleType – to UML Attribute or AssociationEnd type.
Other attributes or elements maps to corresponding tagged values
<attribute
default = string
fixed = string
form = (qualified | unqualified)
id = ID
name = NCName
ref = QName
type = QName
use = (optional | prohibited | required ) optional
{any attributes with non-schema namespace ...} >
Content: (annotation?,(simpleType?))
</attribute>
Example
<xs:attribute name="age" type="xs:positiveInteger" use="required"/>
Ref value is generated from ref or refString TaggedValue. One of ref or name must be present, but not both.
If ref is present, then all of <simpleType>, form and type must be absent. Type and <simpleType> must not both be present.
Example of attribute UML model (1).
<xs:schema xmlns:nm = "http://nomagic.com" xmlns:xs = "http://www.w3.org/2001/XMLSchema" targetNamespace = "http://nomagic.com"
Example of attribute UML code
<xs:attribute name = "name" type = "xs:string" default = "minde"
fixed = "fixed_value" form = "qualified" use "optional" >
<xs:annotation >
<xs:documentation >name attribute
documentation</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name = "address" fixed = "fixed_value" form =
"qualified" use = "optional" >
<xs:annotation >
<xs:documentation >surname attribute
documentation‹/xs:documentation>
</xs:annotation>
<xs:simpleType >
<xs:restriction base = "xs:string" />
‹/xs:simpleType>
</xs:attribute>
<xs:attribute name = "surname" type "xs:string" />
<xs:attributeGroup name = "attr_group" >
<xs:attribute ref "nm:name" >
<xs:annotation >
<xs:documentation >reference
documentation</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute ref = "nm:surname" />
</xs:attributeGroup>
</xs:schema>