Author Topic: Changes in XSD export with EA 14?  (Read 981 times)

Marc Dv.

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Changes in XSD export with EA 14?
« on: July 18, 2018, 11:13:29 pm »
Hello there!

We use EA to model and generate some XSD. Recently we switched to EA 14 and now it looks like the XSD is generated differently to the prior version we used (EA 11). The problem is the order of the generated elements. We had a custom order but now the order is alphabetically. It seems to be the default order of package contents:
  • order of type
  • order of set position
  • alphabetically

I changed the default behavior to "Allow Free Sorting" and disabled "Sort Features Alphabetically" within the object options. But I still get the alphabetical order.

We are two teams responsible for two systems and use the XSD as interfaces between the systems. My team gets the alphabetical order using EA 14. The other team gets the old custom order from the same model using EA 11.

As you can imagine the different XSD causes some validation errors if we try to exchange XML content based on our XSD with the other team.

Are there any changes regarding the order of elements during XSD generation? Is there a new setting in EA 14 we have to set?

Best regards,
Marc

Sunshine

  • EA User
  • **
  • Posts: 916
  • Karma: +77/-7
  • Its the results that count
    • View Profile
Re: Changes in XSD export with EA 14?
« Reply #1 on: July 19, 2018, 06:37:38 am »
Not aware of anything in Sparx EA to address your problem.
If nobody else comes up with a better way to resolve your problem then you could try using XSLT to change the order of the elements.
Happy to help
:)

qwerty

  • EA Guru
  • *****
  • Posts: 11121
  • Karma: +262/-246
  • I'm no guru at all
    • View Profile
Re: Changes in XSD export with EA 14?
« Reply #2 on: July 19, 2018, 04:00:49 pm »
...or to create the XSD with a script. It's no witch work at all.

q.

Marc Dv.

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Changes in XSD export with EA 14?
« Reply #3 on: July 19, 2018, 07:22:16 pm »
Thanks for your replies. I guess the easiest solution is to agree on a rule with the other team: "The order of elements has to be alphabetically."  ::)

But also the "script it" solution sound interesting. Where do I start?  ??? (I never scripted things inside EA).

qwerty

  • EA Guru
  • *****
  • Posts: 11121
  • Karma: +262/-246
  • I'm no guru at all
    • View Profile
Re: Changes in XSD export with EA 14?
« Reply #4 on: July 19, 2018, 11:19:04 pm »
EA has build-in scripting capabilities for JScript (or how that Java stuff is called) and VB (or how this variant is ever called correctly). You can further use any programming language you like and talk to EA via its API. You can click through EA's help for an API reference or (shameless self plug) refer to my Scripting book.

What you'd do (and I did that for a customer) is to get the focused XSD root and traverse its connections down your own rules. You can evaluate tagged values at your wish. Since XSD has no defined mapping to UML you need to setup some rules for that anyway (there are a couple of papers about UML-XSD mapping out there). Further to exporting XSD I also wrote an importer that could synch with the previously imported model.

q.

Marc Dv.

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Changes in XSD export with EA 14?
« Reply #5 on: July 20, 2018, 09:53:29 pm »
Thanks qwerty.