Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Global Element and ComplexType

Some XML Schemas have ComplexType elements with the same name as the referring global elements, but with the suffix 'Type', as shown:

     <xs:element name="Address" type="AddressType"/>

     <xs:complexType name="AddressType">

               <xs:sequence/>

     </xs:complexType>

On XSD import, by default, Enterprise Architect treats this global element and its bounding ComplexType as a single entity, and creates a single XSDcomplexType stereotyped Class with the same name as the global element, as shown:

Global Element and ComplexType XSD example.

You can change this default behavior by selecting the 'Import global elements with "Type" postfix' checkbox on the 'Import XML Schema' dialog. When you select this option, the system treats the global element and the ComplexType it is referring to as two separate entities. For the example, the system creates an «XSDtopLevelElement» stereotyped Class for the global element and an «XSDcomplexType» stereotyped Class for the ComplexType, connected as shown:

Global Element and ComplexType XSD example.

Notes

  • Enterprise Architect treats these two definitions as separate entities irrespective of whether the 'Import global elements with "Type" postfix' checkbox is selected or unselected:

         <xs:element name="HomeAddress" type="AddressType"/>
         <xs:complexType name="AddressType">
                <xs:sequence/>
         </xs:complexType>

Learn more