Hi all,
Sparx responded to my bug reports (as they do) and registered the 'ref' bug as a bug. However, the generation of elements with the same name as a complexType is a design feature and can't be easily changed (as of writing). (And, yes, bennido, it means that you still won't be able to determine which element is the top-level one.)
Apparently, the EA XSD import/export feature makes use of the XSD 'Garden of Eden' design pattern. My request was to make the use of this pattern optional. Thus, when the design pattern is not used, both XSDComplexTypes and XSDElements are generated with the appropriate associations. This would allow me to correctly import UBL XSDs and generate them appropriately, too.
<rant>I hate it when software makes arbitrary decisions about how I should do something. I believe that every developer should read "The Design of Everyday Things" (aka "The Philosophy of Everyday Things" aka "POET") as part of their training so that the "NO SURPRISES!" mantra is drummed into their heads!</rant>
(Takes a few deep breaths...)
Anyway, the solution of arbitrarily combining elements and complextypes into a single complex type on import and naming both complextypes and elements the same on export means that I can't round-trip a XSD. In fact, it reduces EA to the role of passive data dictionary and makes its lauded MDA capability irrelevant at a stroke. And it is all because I am forced to perform post-processing on the generated XSD (to remove the spurious elements and add the suffix "type" to all of the types, etc) - a monumental PITA.
Therefore, if you are reading this, can you please lobby Sparx to get them to change it.
Regards,
Rick