Adding new XSD data types for auto generation...

177 views
Skip to first unread message

wad62

unread,
Jun 20, 2013, 6:50:00 AM6/20/13
to sparx-enterprise-archite...@googlegroups.com
Hi there, first post on this forum, so be gentle�

Within our environment our data modelling tool of choice is ERwin, Sparx being our EA/SA tool of choice.

We have the Toobus ERwin to Sparx EA bridge, which allows me to port my logical data model from ERwin to an equivalent Class Diagram in Sparx EA, which it does very well.

The ultimate goal being to generate XSD object payloads from the Class Diagram model within Sparx, which is almost working perfectly except for one small issue. I�m losing my attribute data type definitions at XSD generation time, and am merely getting undelimited �string� for all of the element definitions.

This is understandable as obviously data types such as CHAR(18) are meaningless to the XSD generator, so my question is�

How can I add new data types to the XSD generator? What I want is for an attribute with a CHAR(18) datatype to be represented as an XSD element of �string� with a max length of 18, upon XSD generation.

To this end I�ve added a new data type or CHAR(18) (common type string length 18) to the XSD product (after adding XSD as a product), via settings/code engineering data types/programming languages datatypes.

�however upon XSD generation I am still receiving the following message;

�Warning no XSD type found for: "CHAR(18)". �Default is: xs:string�

Whilst I appreciate that in certain circumstances an element of unbounded string will be advantageous, I would still like to be able to implement data type and length constraints in my XSDs

Obviously I�m doing something wrong�has anyone else found a way of overcoming this problem, without a lot of manual knife and forking. I�d like to avoid having to include a whole list of potential XML element types in each XSD.

Thanks,

Will




[original message]

wad62

unread,
Jun 25, 2013, 9:20:00 AM6/25/13
to sparx-enterprise-archite...@googlegroups.com
...anyone?  :(
[original message]

wad62

unread,
Mar 19, 2015, 4:25:25 AM3/19/15
to sparx-enterprise-archite...@googlegroups.com
....at all!  :o
[original message]

qwerty

unread,
Mar 19, 2015, 6:16:32 AM3/19/15
to sparx-enterprise-archite...@googlegroups.com
Well, some years ago I generated XSD with a 500 lines Perl script. The import script had 200 lines. They worked well and we had the opportunity to modify them to our needs.

q.

[original message]

wad62

unread,
Mar 20, 2015, 4:35:43 AM3/20/15
to sparx-enterprise-archite...@googlegroups.com
Cheers for the reply...

So there's no way of adding additional XML data 'types' to the Sparx XSD generator... :(

We'll have to look into a custom script, or continue to use ERwin, as we currently do, which is a real shame, given Sparx's potential, and low cost!!!


[original message]

qwerty

unread,
Mar 20, 2015, 6:46:02 AM3/20/15
to sparx-enterprise-archite...@googlegroups.com
AFAIK the XSD stuff is hard coded in EA. Because we had some peculiarities we decided to go the scripting way. The 500/200 lines might give you an impression on the (medium) complexity. Basically it was written within a day and then we had to deal with those peculiarities over time.

q.

[original message]

wad62

unread,
Mar 20, 2015, 12:15:59 PM3/20/15
to sparx-enterprise-archite...@googlegroups.com
Thanks again qwerty, scripting it is then... :)
[original message]

Nascimento@localhost Rodrigo Nascimento

unread,
Mar 24, 2015, 9:26:02 AM3/24/15
to sparx-enterprise-archite...@googlegroups.com
Hi Will,

We are using a similar approach for a client. I may be able to 'partially' answer you question...  ;)

First, I need to understand if you are following the Model Driven Architecture (MDA) approach. For example, we create a Platform Independent Model when we import Erwin models into Sparx EA, then we use the MDA Transformation Template to convert it to a XSD model (Platform Specific Model - PSM). Are you using something similar?

We are using the transformation template to do the transformation of the class model data types to the XSD specific data types (i.e. char to xs:string, date to xs:date...). This can solve your data type 'mapping' issue, but I don't know how to use the restrictions for XSD models (as I never had to use them). This will lead to my next point...

Second, I would like to understand why do you nee to use length restrictions.

Cheers,
Rodrigo

[original message]
Reply all
Reply to author
Forward
0 new messages