Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD2ECORE BUG?(Enum gets generated in a strange way)
XSD2ECORE BUG? [message #686450] Wed, 22 June 2011 09:03 Go to next message
Bak Attila is currently offline Bak AttilaFriend
Messages: 29
Registered: December 2009
Junior Member
Hi,

I have the following xsd segment:

<element name="gewichtsEinheit">
<simpleType>
<restriction base="string">
<enumeration value="gramm"></enumeration>
<enumeration value="kilogramm"></enumeration>
</restriction>
</simpleType>
</element>

I expect to get a gewichtsEinheitType which gets generated ok.
The problem is:
I get an additional gewichtsEinheitTypeObject datatype created because of the method in XSDCoreBuilder -> checkForPrimitive(eEnum);
I think in this case i would not need the additional Datatype created.

Am i missing something?

I know this is stated in the document XSD2EcoreMapping.pdf on page 18 (5.4) but i do not think this is generally correct though...

Thanks
attila

[Updated on: Wed, 22 June 2011 09:22]

Report message to a moderator

(no subject) [message #687538 is a reply to message #686450] Wed, 22 June 2011 16:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Bak,

Comments below.

Bak Attila wrote:
> Hi,
>
> I have the following xsd segment:
>
> <element name="gewichtsEinheit">
> <simpleType>
> <restriction base="string">
> <enumeration value="gramm"></enumeration>
> <enumeration value="kilogramm"></enumeration>
> </restriction>
> </simpleType>
> </element>
>
> I expect to get a gewichtsEinheitType which gets generated ok.
> The problem is:
> I get an additional gewichtsEinheitTypeObject datatype created because
> of the method in XSDCoreBuilder -> checkForPrimitive(eEnum);
> I think in this case i would not need the additional Datatype created.
We generally generate them so that type can be used on a nillable
element. I suppose if the type is anonymous it can't be used for that case.
>
> Am i missing something?
Given that this is just an EDataType that manifests itself only in the
XyzPackage/XyzFactory interface and Impl, not as some additional Java
file that's being generated, I'm not sure it's a special case worth
addressing. Why does it concern you to have it?
>
> Thanks
> attila


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: (no subject) [message #687822 is a reply to message #687538] Thu, 23 June 2011 10:11 Go to previous message
Bak Attila is currently offline Bak AttilaFriend
Messages: 29
Registered: December 2009
Junior Member
OK. Thanks. Not a problem if it is there, not perfect for xsd->ecore->xtext chain though.
Previous Topic:Commit of one transaction results in inactive other transaction
Next Topic:XSD2ECORE Many "Types" generated
Goto Forum:
  


Current Time: Thu Apr 18 02:47:17 GMT 2024

Powered by FUDForum. Page generated in 0.01941 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top