Book a Demo

Author Topic: XSD Generation issues  (Read 4422 times)

Peakey

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
XSD Generation issues
« on: June 25, 2004, 07:37:35 am »
Hi all,

I am currently using EA to generate an XSD and I'm having a few issues, mainly with regard to references.

Basically the main question I have is this: Is it possible to generate an Attribute/Element as a reference <xs:element ref="Asset"/> ?

From my current experiments it appears not and this is causing me problems as it defines elements/attributes twice where there is a link between nodes in my class diagram.

Peakey

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: XSD Generation issues
« Reply #1 on: June 30, 2004, 08:35:26 am »
Some additional information here ...

EA does generate references for linked nodes in a model but it does it in a pretty poor manner. Lets take an example, if you have a class with 5 linked classes, within the generated XSD you get the sub classes defined as complex types with the appropriate sub-elements, which is fine. The problem comes when you look at the main class, it has the sub classes defined as complex types again and has the reference within the complex type, but they should really just be references.

This is poor XML and results in two tiers for each of the sub classes when looked at in XML Spy or another similar XML viewer. It also results in XML Spy not being able to generate sample data as it cant directly links the sub elements to its parent.

I noticed in an example in the help files that this was the case so I am assuming that I am not doing anything wrong and its just the way it is.

If anyone has found a way around this issue then please let me know.

Thanks

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: XSD Generation issues
« Reply #2 on: June 30, 2004, 11:33:41 pm »
Hi Peakey,

There is some work in the pipeline for supporting creation (and referencing) of top-level schema elements. There have been some delays in releasing this, but I am hoping it is not too far away.

So you would create a top-level element like this :

<xs:element name="GlobalFred" etc>

And then reference the global element directly from within complexTypes like this :

<xs:element ref="GlobalFred">

Users have requested this and we intend to support it.

As a work around to the extra levels created by the current form of referencing- would the anonymousRole, anonymousType tags be helpful? You can stereotype a class attribute or association as XSDElement and set these to true. I think a previous thread touched on this:

http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.cgi?board=general;action=display;num=1054648050

Hope this helps.

Regards,
Ben



ddnebert

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: XSD Generation issues
« Reply #3 on: October 20, 2004, 09:03:49 am »
I, too, am confounded by the extra levels of organization that seem to be inserted into the XSD when simply declaring that a UML class has a relationship with another class.

Perhaps more fundamentally, what is the UML pattern understood by EA for modeling hierarchical information that would be expressed cleanly in XML? There are always more than one way to do anything in UML, so publishing patterns with some graphics would be most helpful.

I have the following XML structure, for example:

<GovtUnits>
 <GovernmentalUnit id="12345">
   <name>Franklin County</name>
   <identifier>
       <identifier>42051</identifier>
       <authority>FIPS</authority>
   </identifier>
   <polygon>
     <gml:exterior>
       <LinearRing>
         <gml:posList>1,2 2,3 4,4 4,2 1,2</gml:posList>
       </LinearRing>
     </gml:exterior>
   </polygon>
 </GovernmentalUnit>
</GovtUnits>

and would like to represent this in UML and XSD.