Hi Geert,
Thanks for the information. Your VB library looks very interesting.
I ran some tests with the post-processing script which provides some good examples of improving EA XSD transformation.
Whilst EA is great at being customised to achieve the expected result, I'm trying to figure out the logic behind EA XSD support with the aim to identify exactly the areas that need to be improved (with scripts or Sparx EA enhancements).
-
UML to XSD model transformation mostly leads to XSDComplexType classes with unstereotyped attributes which type is copied as is from the UML model (PIM) e.g int, string, boolean
Note: before transforming a PIM to a PSM model, aggregation links need to be replaced with directed associations.
Inheritance links seem to be supported, although Rodrigo suggests in his blog
blog to create XSD Choices (this should be supported in Sparx EA transformation scripts perhaps via an option to create XSDChoices for inheritance. Alternatively a script can be used to achieve this)
--> Feature request 1
- Once the transformation has been carried out, results are shown in a class diagram
Note: there is an
XML Schema toolbox in EA which should IMHO be displayed with this diagram. However there doesn't seem to be any diagram type associated with this toolbox in EA (should be added by Sparx).
--> Feature request 2
- Attributes are not stereotyped. However when you use the XML Schema toolbox, you notice that XSD elements and XSD attributes can be defined. Advantage is to have access to XML Schema primitive data types. So it would appear more suitable to get XSDElement stereotyped attributes as a result of EA XSD transformation.
--> Feature request 3
- Once the XML Schema model is completed, XSD or JSON files can be generated using the
Schema Composer. This tool provides the advantage of letting you create several profiles from the same model if needed, where a selection can be carried out on what needs to be included for a message.
Note: XSDElement and XSDAttribute attributes are not properly supported when the XSD file is generated i.e. the data type is missing
In the following example, attribute1 is stereotyped XSDAttribute with the string type, and element1 is stereotypedXSDElement with the string type
<xs:complexType name="Product">
<xs:sequence>
<xs:element name="attribute1" minOccurs="1" maxOccurs="1" type=""/>
<xs:element name="element1" minOccurs="1" maxOccurs="1" type=""/>
<xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
</xs:sequence>
</xs:complexType>