Book a Demo

Author Topic: XML Schema import question  (Read 3372 times)

evgelebede

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
XML Schema import question
« on: August 11, 2016, 10:56:40 pm »
Hi,

I'm importing separate XSD files with a number of complexTypes.
They all belong to the same namespace test1.

In tst_ElementC.xsd, tst_ElementC_2 complex type has an element of type test1:tst_ElementC_1, which is declared in the same XSD file.
Result in EA: an association is created between tst_ElementC_1 & tst_ElementC_2. -> expected result (OK)

In tst_ElementC.xsd, tst_ElementC_1 complex type has an element (elementA) of type test1:tst_ElementA, which declared in tst_ElementA.xsd.
Result in EA: elementA is declared as an attribute of tst_ElementC_1 which type is tst_ElementA -> I was expecting an association between tst_ElementC_1 and tst_ElementA.

Is there any way to achieve what I'm looking for, or is there a reason explaining why we're getting this?
Note that I chose the option to import XSD Elements/Attributes as UML Associations.

As a workaround I could define a script that will replace all attribute types with associations but this can be time consuming both for me and the users.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: XML Schema import question
« Reply #1 on: August 11, 2016, 11:56:24 pm »
I guess you can't do much about that (I have to say, that I haven't used XSD for quite some time, but I'm not aware of many changes in that area). Because XML/XSD mapping is not possible 1:1 we used to have our own im-/export using the API. However, if most of the Sparx implementation suits your needs you could just go with the simple association conversion you mentioned.

q.