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

Prev Next

XML from Abstract Class Models

You can model XML schemas using only simple, abstract Class models. This makes it possible for an architect, for example, to start working at a higher level of abstraction without concern for the implementation details of a Schema. Whilst such an abstract model can subsequently be refined using the 'XML Schema' pages of the Toolbox, it can be also be generated directly by Enterprise Architect's Schema Generator, in which case the Schema Generator applies a set of default mappings to convert the abstract model to an XSD file.





This is a simple Class element version of the earlier Employee Details example model. It does not use XSD-specific stereotypes or Tagged Values.


This schema fragment can be generated from the above model:

<?xml version="1.0"?>

<xs:schema xmlns:xs="">

<xs:simpleType name="Status">

<xs:restriction base="xs:string">

<xs:enumeration value="Full-Time"/>

<xs:enumeration value="Part-Time"/>

<xs:enumeration value="Casual"/>

<xs:enumeration value="Contract"/>



<xs:element name="Person" type="Person"/>

<xs:complexType name="Person">


<xs:element name="firstName" type="xs:string"/>

<xs:element name="surName" type="xs:string"/>

<xs:element name="birthDate" type="xs:string"/>

<xs:element name="gender" type="xs:string"/>

<xs:element name="contactDetails" type="ContactInfo"/>



<xs:element name="Employee" type="Employee"/>

<xs:complexType name="Employee">


<xs:extension base="Person">


<xs:element name="status" type="Status"/>

<xs:element name="jobTitle" type="xs:string"/>

<xs:element name="startDate" type="xs:date"/>

<xs:element name="department" type="xs:string"/>





<xs:element name="EmployeeRecords" type="EmployeeRecords"/>

<xs:complexType name="EmployeeRecords">


<xs:element name="Employee" type="Employee" minOccurs="0" maxOccurs="unbounded"/>



<xs:element name="ContactInfo" type="ContactInfo"/>

<xs:complexType name="ContactInfo">


<xs:element name="homePhone" type="xs:string"/>

<xs:element name="mobilePhone" type="xs:string"/>

<xs:element name="officePhone" type="xs:string"/>

<xs:element name="email" type="xs:string"/>

<xs:element name="streetAddress" type="xs:string"/>




Learn more