Skip to main content



      Home
Home » Modeling » EMF » Customized XML persistence
Customized XML persistence [message #398569] Wed, 15 February 2006 10:51 Go to next message
Eclipse UserFriend
Hi,

I am looking into customizing XML persistence, and I'd like to solve the
following problem:

I have a model which persists to something like

<foo bar="whatEverValue" />

which I'd like to have persisted conforming to a given schema, so that
it looks like:

<foo>
<att-name>bar</att-name>
<att-value>whatEverValue</att-value>
</foo>

I have tried with the XMLMap option for loading and saving, which works
fine as far as a simple mapping can go, that is for instance making the
bar attribute an element, like:

<foo>
<bar>whatEverValue</bar>
</foo>

but that's only half of the story so far. From searching the web I got
the impression that there is a more flexible mechanism that has to do
with the ExtendedMetaData interface, but I could not find enough to see
how I could use that for my problem (if it is possible to use it there
at all :-).

So, my question is: is what I want possible without subclassing and
overriding XMLLoadImpl and friends, perhaps with the ExtendedMetaData,
and if so, could someone point me to more information how to do it?

Thanks && ciao,
Leif
Re: Customized XML persistence [message #398572 is a reply to message #398569] Wed, 15 February 2006 12:09 Go to previous messageGo to next message
Eclipse UserFriend
Leif,

No. You are trying to write meta data (the feature name) as normal
data, and you're separating that name from the value associated with the
feature. This will require specialized XMLHandler code and specialized
XMLSaveImpl code.


Leif Frenzel wrote:
> Hi,
>
> I am looking into customizing XML persistence, and I'd like to solve the
> following problem:
>
> I have a model which persists to something like
>
> <foo bar="whatEverValue" />
>
> which I'd like to have persisted conforming to a given schema, so that
> it looks like:
>
> <foo>
> <att-name>bar</att-name>
> <att-value>whatEverValue</att-value>
> </foo>
>
> I have tried with the XMLMap option for loading and saving, which works
> fine as far as a simple mapping can go, that is for instance making the
> bar attribute an element, like:
>
> <foo>
> <bar>whatEverValue</bar>
> </foo>
>
> but that's only half of the story so far. From searching the web I got
> the impression that there is a more flexible mechanism that has to do
> with the ExtendedMetaData interface, but I could not find enough to see
> how I could use that for my problem (if it is possible to use it there
> at all :-).
>
> So, my question is: is what I want possible without subclassing and
> overriding XMLLoadImpl and friends, perhaps with the ExtendedMetaData,
> and if so, could someone point me to more information how to do it?
>
> Thanks && ciao,
> Leif
>
Re: Customized XML persistence [message #398576 is a reply to message #398572] Wed, 15 February 2006 12:57 Go to previous message
Eclipse UserFriend
> No. You are trying to write meta data (the feature name) as normal
> data, and you're separating that name from the value associated with the
> feature. This will require specialized XMLHandler code and specialized
> XMLSaveImpl code.
Ok, then I'll try that. Thanks :-)

Ciao,
Leif


>
>
> Leif Frenzel wrote:
>> Hi,
>>
>> I am looking into customizing XML persistence, and I'd like to solve the
>> following problem:
>>
>> I have a model which persists to something like
>>
>> <foo bar="whatEverValue" />
>>
>> which I'd like to have persisted conforming to a given schema, so that
>> it looks like:
>>
>> <foo>
>> <att-name>bar</att-name>
>> <att-value>whatEverValue</att-value>
>> </foo>
>>
>> I have tried with the XMLMap option for loading and saving, which works
>> fine as far as a simple mapping can go, that is for instance making the
>> bar attribute an element, like:
>>
>> <foo>
>> <bar>whatEverValue</bar>
>> </foo>
>>
>> but that's only half of the story so far. From searching the web I got
>> the impression that there is a more flexible mechanism that has to do
>> with the ExtendedMetaData interface, but I could not find enough to see
>> how I could use that for my problem (if it is possible to use it there
>> at all :-).
>>
>> So, my question is: is what I want possible without subclassing and
>> overriding XMLLoadImpl and friends, perhaps with the ExtendedMetaData,
>> and if so, could someone point me to more information how to do it?
>>
>> Thanks && ciao,
>> Leif
>>
Previous Topic:reloading genmodel fails
Next Topic:Simple EMF Encryption How To
Goto Forum:
  


Current Time: Wed Nov 05 15:20:23 EST 2025

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

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

Back to the top