Re: serialize ecore references into container [message #639714] |
Wed, 17 November 2010 14:58 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Florian,
Please use the EMF newsgroup (eclipse.tools.emf) for future questions
about EMF. More comments below.
Florian Marienfeld wrote:
> Hi,
>
> suppose I have this metamodel:
>
> class Chair has a reference named "parts" of type "Part". Part is
> superclass to classes Leg and Arm.
>
> by default a model instance gets serialized to this:
>
> <chair:Chair xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:chair="chair.de">
> <parts xsi:type="chair:Arm"/>
> <parts xsi:type="chair:Leg"/>
> </chair:Chair>
>
> What I would like is:
>
> <Chair>
> <Parts>
> <Arm/>
> <Leg/>
> </Parts>
> </Chair>
>
> What is the way to go?
>
Best is to write a schema with substitution groups and follow the steps
outlined in http://ed-merks.blogspot.com/2007/12/winters-icy-grip.html
to avoid ending up with a horrible API.
> Best regards, thanks in advance,
>
> FLO
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03502 seconds