Community
Participate
Working Groups
Build Identifier: M20100909-0800 By default, the XSD to Ecore builder does not preserve attribute order (unless the attributes are part of an attribute group). Add an option in the UI to control this. See: http://www.eclipse.org/forums/index.php?t=msg&th=199864 Reproducible: Always Steps to Reproduce: A type defined: <xsd:complexType name="MyType"> <xsd:attribute name="b" type="xsd:string"></xsd:attribute> <xsd:attribute name="c" type="xsd:string"></xsd:attribute> <xsd:attribute name="a" type="xsd:string"></xsd:attribute> </xsd:complexType> will produce Ecore (attributes sorted alphabetically): -MyType --a --b --c
An additional thought: Should preservation be the default behavior? The act of sorting something seems side-effect like, and thus an 'optional' thing.
You can imagine that the thousands of people who have already generated models might not be happy to have them ordered differently suddenly, right?
Yes, I guess I was only thinking of the default value for an option on the wizard page when creating a new model from XML, and that it wouldn't be affecting existing models just new ones being created through the wizard. But I guess if it is a change in expected behavior for people re-creating a model through the wizard (or if the same UI code is involved in a reload?), then of course, I guess we're stuck. Obviously I didn't think everything through (I don't even know all the details to think through), its just a comment from my personal experience with creating an EMF model from XML for the first time. Regardless of my dubious or silly comment on default values, I think having options in the UI wizard to control the XML to EMF generator would be nice. I have to setup and execute XSDEcoreBuilder programatically instead of through the wizard every time I want this option. I also realize that these kind of UI improvements that cater more to new EMF users are probably really low priority.
*** This bug has been marked as a duplicate of bug 236609 ***