Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to inject ecore:reference with a QName without modifying a xsd
How to inject ecore:reference with a QName without modifying a xsd [message #504851] Wed, 23 December 2009 03:32 Go to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Hi,

I'm working on a xsd I cannot modify. It makes references between
elements of the model using QNames.

An obvious example is an edge that has a source and a target. They
relate to each other through QName references.

Of course the xsd doesn't define the type of the object referenced by
the QName, which leads EMF to create EAttributes attached to the Message
object, of type QName.

What I would like, instead of an EAttribute, is to have a EReference.

Usually I would just add a ecore:reference attribute to the complex type
definition in the xsd, but here it's forbidden.

Is there a way to imply an EReference in the xsd2ecore file ?

Any help is very welcome.

Thanks,

Antoine
Re: How to inject ecore:reference with a QName without modifying a xsd [message #504941 is a reply to message #504851] Wed, 23 December 2009 11:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Antoine,

Comments below.

Antoine Toulme wrote:
> Hi,
>
> I'm working on a xsd I cannot modify. It makes references between
> elements of the model using QNames.
>
> An obvious example is an edge that has a source and a target. They
> relate to each other through QName references.
>
> Of course the xsd doesn't define the type of the object referenced by
> the QName, which leads EMF to create EAttributes attached to the
> Message object, of type QName.
>
> What I would like, instead of an EAttribute, is to have a EReference.
>
> Usually I would just add a ecore:reference attribute to the complex
> type definition in the xsd, but here it's forbidden.
>
> Is there a way to imply an EReference in the xsd2ecore file ?
No, there's no support for treating a QName as an EReference.
>
> Any help is very welcome.
You might define a derived EReference that's computed from the
information in the QName EAttribute, but there's no way to inject that
purely via annotations into the XSD.
>
> Thanks,
>
> Antoine


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to inject ecore:reference with a QName without modifying a xsd [message #504943 is a reply to message #504941] Wed, 23 December 2009 16:55 Go to previous message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Thanks Ed. That should just work. I will keep two fields then:

an EAttribute with nameRef of type QName.
a derived EReference with name with the right type.

It's really verbose but hey.

On 12/23/09 8:27 AM, Ed Merks wrote:
> Antoine,
>
> Comments below.
>
> Antoine Toulme wrote:
>> Hi,
>>
>> I'm working on a xsd I cannot modify. It makes references between
>> elements of the model using QNames.
>>
>> An obvious example is an edge that has a source and a target. They
>> relate to each other through QName references.
>>
>> Of course the xsd doesn't define the type of the object referenced by
>> the QName, which leads EMF to create EAttributes attached to the
>> Message object, of type QName.
>>
>> What I would like, instead of an EAttribute, is to have a EReference.
>>
>> Usually I would just add a ecore:reference attribute to the complex
>> type definition in the xsd, but here it's forbidden.
>>
>> Is there a way to imply an EReference in the xsd2ecore file ?
> No, there's no support for treating a QName as an EReference.
>>
>> Any help is very welcome.
> You might define a derived EReference that's computed from the
> information in the QName EAttribute, but there's no way to inject that
> purely via annotations into the XSD.
>>
>> Thanks,
>>
>> Antoine
Previous Topic:segmented models and lazy loading
Next Topic:persisting unchangeable attributes
Goto Forum:
  


Current Time: Fri Apr 19 01:23:19 GMT 2024

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

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

Back to the top