Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD to ECore changing element class
XSD to ECore changing element class [message #1161719] Wed, 30 October 2013 00:37 Go to next message
Eclipse UserFriend
Generating a model from a XSD and have used the ecore:name annotation to
successfully change the names of generated ECore classes in types and
attributes, but have no luck doing it for elements.

For example I have an:


<xs:element name="ProgramStatusType" ecore:name="ProgramStatus">

but the generated class comes out:
ProgramStatusTypeType.class

Also note that in the ecore model I see extended metadata like this:
Value ProgramStatusType_._type

Am I using the right annotation in the XSD to change the names of
elements or have I missed something?

thanks for any help,
John
Re: XSD to ECore changing element class [message #1161731 is a reply to message #1161719] Wed, 30 October 2013 00:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30686
Registered: July 2009
Senior Member
John,

Comments below.

On 30/10/2013 1:37 AM, John E. Conlon wrote:
> Generating a model from a XSD and have used the ecore:name annotation
> to successfully change the names of generated ECore classes in types
> and attributes, but have no luck doing it for elements.
>
> For example I have an:
>
>
> <xs:element name="ProgramStatusType" ecore:name="ProgramStatus">
>
> but the generated class comes out:
> ProgramStatusTypeType.class
Elements don't map to EClasses so such an annotation would only change
the name of a feature...
>
> Also note that in the ecore model I see extended metadata like this:
> Value ProgramStatusType_._type
There must be an anonymous complex type involved so that's where you
should put the name annotation.
>
> Am I using the right annotation in the XSD to change the names of
> elements or have I missed something?
I imagine it's just not in the right place...
>
> thanks for any help,
> John
Re: XSD to ECore changing element class [message #1161967 is a reply to message #1161731] Wed, 30 October 2013 04:30 Go to previous message
Eclipse UserFriend
Thanks Ed, Moving the annotations to the anonymous types does the trick.

On 10/29/2013 07:49 PM, Ed Merks wrote:
> John,
>
> Comments below.
>
> On 30/10/2013 1:37 AM, John E. Conlon wrote:
>> Generating a model from a XSD and have used the ecore:name annotation
>> to successfully change the names of generated ECore classes in types
>> and attributes, but have no luck doing it for elements.
>>
>> For example I have an:
>>
>>
>> <xs:element name="ProgramStatusType" ecore:name="ProgramStatus">
>>
>> but the generated class comes out:
>> ProgramStatusTypeType.class
> Elements don't map to EClasses so such an annotation would only change
> the name of a feature...
>>
>> Also note that in the ecore model I see extended metadata like this:
>> Value ProgramStatusType_._type
> There must be an anonymous complex type involved so that's where you
> should put the name annotation.
>>
>> Am I using the right annotation in the XSD to change the names of
>> elements or have I missed something?
> I imagine it's just not in the right place...
>>
>> thanks for any help,
>> John
>
Previous Topic:[CDO]Persistent Ecore dynamic model to the database????
Next Topic:Upper case letters in URI
Goto Forum:
  


Current Time: Sun Dec 08 15:22:14 GMT 2019

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

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

Back to the top