Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] XML serialization for arraylist(TEXO XML serialization for EReference with containment at true)
[TEXO] XML serialization for arraylist [message #632744] Thu, 14 October 2010 07:00 Go to next message
Jean Duracel is currently offline Jean Duracel
Messages: 10
Registered: October 2010
Junior Member
Dear readers,

In my ecore file I have :

<eStructuralFeatures
xsi:type="ecore:EReference"
name="achats" upperBound="-1"
eType="ecore:EClass BaseObject.ecore#//Achats" containment="true" resolveProxies="false">
</eStructuralFeatures>

Which gave me :
private List<Achats> achats = new ArrayList<Achats>();

When serialized with ModelXMLSaver :

<achats libelle1="medovina"/>
<achats libelle1="pruknik"/>

Is there a way to change this with something like :
<achats>
<item libelle1="medovina"/>
<item libelle1="pruknik"/>
</achats>

Maybe by using annotation inside the ecore file ?

Thanks a lot for your comment.
Re: [TEXO] XML serialization for arraylist [message #632767 is a reply to message #632744] Thu, 14 October 2010 08:21 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5335
Registered: July 2009
Senior Member
Hi Jean,
Not supported right now I am afraid. Texo uses standard EMF XML serialization, I found this older post/reply on the EMF
newsgroup:
http://www.eclipse.org/forums/index.php?t=tree&goto=4004 01&#page_top

There is this open bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201662

@Ed, if we ignore the suppressing elements/levels when serializing and just look at adding a level for
serializing/de-serializing lists, is that part very complex to do? (if doable I can make a shot at it as part of the
Texo project, maybe it can later be moved over to EMF, if it works :-)).

gr. Martin

On 10/14/2010 09:00 AM, Jean Duracel wrote:
> Dear readers,
>
> In my ecore file I have :
>
> <eStructuralFeatures xsi:type="ecore:EReference"
> name="achats" upperBound="-1"
> eType="ecore:EClass BaseObject.ecore#//Achats" containment="true"
> resolveProxies="false">
> </eStructuralFeatures>
>
> Which gave me :
> private List<Achats> achats = new ArrayList<Achats>();
>
> When serialized with ModelXMLSaver :
>
> <achats libelle1="medovina"/>
> <achats libelle1="pruknik"/>
>
> Is there a way to change this with something like :
> <achats>
> <item libelle1="medovina"/>
> <item libelle1="pruknik"/>
> </achats>
>
> Maybe by using annotation inside the ecore file ?
>
> Thanks a lot for your comment.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [TEXO] XML serialization for arraylist [message #632783 is a reply to message #632767] Thu, 14 October 2010 09:14 Go to previous messageGo to next message
Jean Duracel is currently offline Jean Duracel
Messages: 10
Registered: October 2010
Junior Member
Hello Martin,

I will modify my xml files to meet this point.

Thanks for your quick answer and good work.
Re: [TEXO] XML serialization for arraylist [message #632943 is a reply to message #632767] Thu, 14 October 2010 17:32 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26088
Registered: July 2009
Senior Member
Martin,

There's quite an extensive patch in there. It's been a long time since
I looked but my comments there indicate it's still rough. Part of the
reason for focusing on the XML Schema stuff is that the serialization
and deserialization guidance is driven largely from ExtendedMetaData, so
if new tweaks are to be introduced, it's best for them to be properly
integrated with all the existing stuff that's intended to keep the
serialization conforming to some reasonable schema. I think there's
quite a bit of work left to do...


Martin Taal wrote:
> Hi Jean,
> Not supported right now I am afraid. Texo uses standard EMF XML
> serialization, I found this older post/reply on the EMF newsgroup:
> http://www.eclipse.org/forums/index.php?t=tree&goto=4004 01&#page_top
>
> There is this open bugzilla:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=201662
>
> @Ed, if we ignore the suppressing elements/levels when serializing and
> just look at adding a level for serializing/de-serializing lists, is
> that part very complex to do? (if doable I can make a shot at it as
> part of the Texo project, maybe it can later be moved over to EMF, if
> it works :-)).
>
> gr. Martin
>
> On 10/14/2010 09:00 AM, Jean Duracel wrote:
>> Dear readers,
>>
>> In my ecore file I have :
>>
>> <eStructuralFeatures xsi:type="ecore:EReference"
>> name="achats" upperBound="-1"
>> eType="ecore:EClass BaseObject.ecore#//Achats" containment="true"
>> resolveProxies="false">
>> </eStructuralFeatures>
>>
>> Which gave me :
>> private List<Achats> achats = new ArrayList<Achats>();
>>
>> When serialized with ModelXMLSaver :
>>
>> <achats libelle1="medovina"/>
>> <achats libelle1="pruknik"/>
>>
>> Is there a way to change this with something like :
>> <achats>
>> <item libelle1="medovina"/>
>> <item libelle1="pruknik"/>
>> </achats>
>>
>> Maybe by using annotation inside the ecore file ?
>>
>> Thanks a lot for your comment.
>
>
Previous Topic:[TEXO] Annotation and XML attribute vs element
Next Topic:[EMF Compare] Duplicate differences into DiffModel
Goto Forum:
  


Current Time: Wed Oct 01 04:15:03 GMT 2014

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

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