Dear all,
I am modeling to generate re-usable enterprise XML Schema components for the composition of application messages. Examples of these components include, Party.
When I create a normal class, for example, a FullName with attributes, FirstName and Surname, EA creates the schema:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<xs:element name="FullName" type="FullName"/>
<xs:complexType name="FullName">
<xs:sequence>
<xs:element name="FirstName" type="xs:string" minOccurs="0"/>
<xs:element name="Surname" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
I was advised by a developer that this fragment is not re-usable when imported into other message schema because, the elements FirstName and Surname are not declared as global XSDsimpleTypes.
I then recreated the model with the fullName as a class with stereotype XSDcomplexType and the two attributes as classes with stereotype XSDsimpleType. I was able to generate the kind of XSD considered by the developers to be re-usable below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<xs:element name="FullName" type="FullName"/>
<xs:complexType name="FullName">
<xs:sequence>
<xs:element name="Surname" type="Surname" minOccurs="0"/>
<xs:element name="FirstName" type="FirstName" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="FirstName">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="Surname">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
While this solution worked for very small models, the kind of classes in my model may have up to 30 data attributes, which make this approach difficult for large models.
A solution to my problem is to create the attributes as is normally done but set its stereotype to XSDsimpletype within the class. This should be equivalent to the last model but when I try to generate, I get the firts schema.
Does anyone know how to modify the EA transformer to achieve good result. I need a solution fast else my job is on the line given that I introduced EA to the company.
I appreciate any help. Thank you in anticipation.
salayande