Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Code generation problem(Some questions about Ecore and Genmodel)
icon5.gif  EMF Code generation problem [message #900264] Mon, 06 August 2012 09:10 Go to next message
yu wang is currently offline yu wang
Messages: 2
Registered: August 2012
Junior Member
Hi all,

I am new to the EMF and I am trying to generate code like this:
<eclass:myeclass>
<id>
myvalue
</id>
</eclass:myeclass>

but it is always like this:
<eclass:myeclass id="myvalue" /> Sad

I changed the feature kind to element but it seems does not work.

and I found it's different between create ecore from schema(xsd) file and create ecore from ecore diagram.

create ecore from xsd file can choose EType like String Boolean...but if I create ecore from ecore diagram I can only choose EString EBoolen, Why? Rolling Eyes

I hope someone out there can help.
Best regards ,
Yu.
Re: EMF Code generation problem [message #900312 is a reply to message #900264] Mon, 06 August 2012 12:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26126
Registered: July 2009
Senior Member
Yu,

Comments below.
On 06/08/2012 11:10 AM, yu wang wrote:
> Hi all,
>
> I am new to the EMF and I am trying to generate code like this:
> <eclass:myeclass>
> <id>
> myvalue
> </id>
> </eclass:myeclass>
>
> but it is always like this:
> <eclass:myeclass id="myvalue" /> :(
> I changed the feature kind to element but it seems does not work.
You need to use XMLResource.EXTENDED_META_DATA options for the extended
metadata annotations to take effect. Have a look at the generated
resource factory for a model based on XML Schema.
>
> and I found it's different between create ecore from schema(xsd) file
> and create ecore from ecore diagram.
>
> create ecore from xsd file can choose EType like String Boolean...but
> if I create ecore from ecore diagram I can only choose EString
> EBoolen, Why? :roll:
You can load the Ecore model for the XMLType package if you want access
to the built-in data type for XML Schema.
> I hope someone out there can help.
> Best regards ,
> Yu.
Re: EMF Code generation problem [message #900436 is a reply to message #900312] Tue, 07 August 2012 06:05 Go to previous message
yu wang is currently offline yu wang
Messages: 2
Registered: August 2012
Junior Member
much preciated~
It seems that I have to work hard Very Happy
Previous Topic:XML Schema and upper/lower bounds
Next Topic:XMLTypeFactoryImpl doesn't support XSD compliant representations of infinity
Goto Forum:
  


Current Time: Tue Oct 21 03:51:37 GMT 2014

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

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