Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Richer EMF model than the one generated by XSD
Richer EMF model than the one generated by XSD [message #422847] Wed, 17 September 2008 08:24 Go to next message
Ola Spjuth is currently offline Ola SpjuthFriend
Messages: 47
Registered: July 2009
Member
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30804
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.&nbsp;&nbsp;
You can mark such features using ecore:transient so they won't be
serialized.&nbsp; 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--
Re: Richer EMF model than the one generated by XSD [message #422861 is a reply to message #422857] Wed, 17 September 2008 15:33 Go to previous message
Ola Spjuth is currently offline Ola SpjuthFriend
Messages: 47
Registered: July 2009
Member
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
Previous Topic:Validation question
Next Topic:Problem resolving EAnnotation references
Goto Forum:
  


Current Time: Sun Jan 19 13:41:01 GMT 2020

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

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

Back to the top