Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Inserting intermediate nodes in XML persistence format
Inserting intermediate nodes in XML persistence format [message #400401] Tue, 18 April 2006 15:45 Go to previous message
Tillmann Seidel is currently offline Tillmann Seidel
Messages: 5
Registered: July 2009
Junior Member
Hi,

I am looking for an easy solution to change the way EMF persists model
instances to XML. My specific problem is how to insert intermediate
grouping nodes into the XML tree without having to alter the model
itself or mess around with the persistence.

Let's assume we have a model with two classes:

class C2 {
String name;
}

and

class C1 {
EList c2s; // contains instances of C2
}

where c2s contains a list of instances of C2.

Creating a model instance and persisting it to XML will lead to
something like

<C1>
<c2s name="foo"/>
<c2s name="bar"/>
</C1>

Now what we would like to have is an XML representation where all
instances of C2 are contained in an intermediate grouping node c2s:

<C1>
<c2s>
<C2 name="foo"/>
<C2 name="bar"/>
</c2s>
</C1>

My question is: can this kind of XML representation be configured using
the ExtendedMetaData annotation mechanism?

Thanks in advance
Tillmann
 
Read Message
Read Message
Previous Topic:Weak References on containment
Next Topic:Creating a model from an existing Database!?
Goto Forum:
  


Current Time: Thu Sep 18 17:53:25 GMT 2014

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

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