Richer EMF model than the one generated by XSD [message #422847] |
Wed, 17 September 2008 08:24 |
Eclipse User |
|
|
|
Hi,
I have an XSD (which I can't change and should be used to validate my
produced XML files) and generated an EMF model from it. Now, I want my
EMF model to be richer than the generated one, to hold computed
properties that will not be persisted to XML upon save. Should I use
dynamic EMF to go about this or is there an easier solution (like create
a new EMF model that extends the generated and use that)? How do people
generally implement this?
Thanks a lot,
/Ola
|
|
|
Re: Richer EMF model than the one generated by XSD [message #422857 is a reply to message #422847] |
Wed, 17 September 2008 14:05 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070405070506090908030903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Ola,
Comments below.
Ola Spjuth wrote:
> Hi,
>
> I have an XSD (which I can't change and should be used to validate my
> produced XML files) and generated an EMF model from it. Now, I want my
> EMF model to be richer than the generated one, to hold computed
> properties that will not be persisted to XML upon save. Should I use
> dynamic EMF to go about this or is there an easier solution (like
> create a new EMF model that extends the generated and use that)? How
> do people generally implement this?
I'd make a copy of the unchangeable XSD and add features as needed.
You can mark such features using ecore:transient so they won't be
serialized. If we addressed these, there'd be other ways:
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196041
>
> Thanks a lot,
>
> /Ola
>
--------------070405070506090908030903
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ola,<br>
<br>
Comments below.<br>
<br>
<br>
Ola Spjuth wrote:
<blockquote cite="mid:gaqek6$mtk$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I have an XSD (which I can't change and should be used to validate my
produced XML files) and generated an EMF model from it. Now, I want my
EMF model to be richer than the generated one, to hold computed
properties that will not be persisted to XML upon save. Should I use
dynamic EMF to go about this or is there an easier solution (like
create a new EMF model that extends the generated and use that)? How do
people generally implement this?
<br>
</blockquote>
I'd make a copy of the unchangeable XSD and add features as needed.
You can mark such features using ecore:transient so they won't be
serialized. If we addressed these, there'd be other ways:<a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943"><br>
</a>
<blockquote><a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943">https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943</a><br>
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=196041">https://bugs.eclipse.org/bugs/show_bug.cgi?id=196041</a><br>
</blockquote>
<blockquote cite="mid:gaqek6$mtk$1@build.eclipse.org" type="cite"><br>
Thanks a lot,
<br>
<br>
/Ola
<br>
<br>
</blockquote>
</body>
</html>
--------------070405070506090908030903--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Richer EMF model than the one generated by XSD [message #422861 is a reply to message #422857] |
Wed, 17 September 2008 15:33 |
Eclipse User |
|
|
|
Thanks Ed.
I have voted for these bugs, would be great to have this possibility!
For now I will do as you propose and have two schemas, one public and
one internal, where the internal contains additional transient attributes.
Cheers,
/Ola
Ed Merks wrote:
> Ola,
>
> Comments below.
>
>
> Ola Spjuth wrote:
>> Hi,
>>
>> I have an XSD (which I can't change and should be used to validate my
>> produced XML files) and generated an EMF model from it. Now, I want my
>> EMF model to be richer than the generated one, to hold computed
>> properties that will not be persisted to XML upon save. Should I use
>> dynamic EMF to go about this or is there an easier solution (like
>> create a new EMF model that extends the generated and use that)? How
>> do people generally implement this?
> I'd make a copy of the unchangeable XSD and add features as needed.
> You can mark such features using ecore:transient so they won't be
> serialized. If we addressed these, there'd be other ways:
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943>
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=197943
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=196041
|
|
|
Powered by
FUDForum. Page generated in 0.02850 seconds