Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Convert emf model in xml
Convert emf model in xml [message #648807] Fri, 14 January 2011 15:23 Go to next message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Hello everybody!

I would like to be able to transform an emf model in xml.

I have created a metamodel (ecore file and a genmodel file).
In the genmodel file I choose the option to generate the xml model.
So at the generation, a xsd file and a xsd2ecore file.
But I don't know how to use it to transfom ons model in xml.
I don't really find documentation for the xsd2ecore file.

Someone know how can I do that ?

Sorry for my baf english.

Thanks;

Jérémie


Re: Convert emf model in xml [message #648825 is a reply to message #648807] Fri, 14 January 2011 16:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080709060107030707050309
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Jérémie,

It sounds like you need to follow these:

Tutorial: Generating an EMF Model using XML Schema
< http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html>
Binding XML to Java
< http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava>


jeremie wrote:
> Hello everybody!
>
> I would like to be able to transform an emf model in xml.
>
> I have created a metamodel (ecore file and a genmodel file).
> In the genmodel file I choose the option to generate the xml model.
> So at the generation, a xsd file and a xsd2ecore file.
> But I don't know how to use it to transfom ons model in xml.
> I don't really find documentation for the xsd2ecore file.
>
> Someone know how can I do that ?
>
> Sorry for my baf english.
>
> Thanks;
>
> Jérémie
>
>
>

--------------080709060107030707050309
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jérémie,<br>
<br>
It sounds like you need to follow these:<br>
<blockquote><a
href=" http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.emf.doc/tutorials/xlibmod/xlibmod.html">Tutorial:
Generating an EMF Model using XML Schema</a><br>
<a target="_out"
href=" http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava">Binding
XML to Java</a><br>
</blockquote>
<br>
jeremie wrote:
<blockquote cite="mid:igppf8$72h$1@news.eclipse.org" type="cite">Hello
everybody!
<br>
<br>
I would like to be able to transform an emf model in xml.
<br>
<br>
I have created a metamodel  (ecore file and a genmodel file).
<br>
In  the genmodel file I choose the option to generate the xml model.
<br>
So at the generation, a xsd file and a xsd2ecore file.
<br>
But I don't know how to use it to transfom ons model in xml.
<br>
I don't really find documentation for the  xsd2ecore file.
<br>
<br>
Someone know how can I do that ?
<br>
<br>
Sorry for my baf english.
<br>
<br>
Thanks;
<br>
<br>
Jérémie
<br>
<br>
<br>
<br>
</blockquote>
</body>
</html>

--------------080709060107030707050309--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Convert emf model in xml [message #648889 is a reply to message #648825] Fri, 14 January 2011 23:36 Go to previous messageGo to next message
jeremie is currently offline jeremieFriend
Messages: 233
Registered: April 2010
Senior Member
Thanks ed for your links.

But in fact, I would like the oposite.
I wil try explain better.
I have my metamodel ecore. (for ecemple Entity.ecore)
with that I can generate model files (for exemple test1.entity)

The generation (with the genmodele created 2 files :
* Entity.xsd
* Entity.xsd2ecore

now I would like to transform my file test1.entity to an xml file (test1.xml) wich can be validate with the xsd file entity.xsd.

I hope this new explication is better,

Regard;

jeremie
Re: Convert emf model in xml [message #648935 is a reply to message #648889] Sat, 15 January 2011 19:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Jeremie,

Comments below.

jeremie wrote:
> Thanks ed for your links.
>
> But in fact, I would like the oposite.
> I wil try explain better.
> I have my metamodel ecore. (for ecemple Entity.ecore)
> with that I can generate model files (for exemple test1.entity)
>
> The generation (with the genmodele created 2 files :
> * Entity.xsd
> * Entity.xsd2ecore
>
> now I would like to transform my file test1.entity to an xml file
> (test1.xml) wich can be validate with the xsd file entity.xsd.
If you Export your Ecore model (using the GenModel) to an XML Schema
(or XMI Schema, depending on what type of serialization you use for
*.entity) then the result should be a schema to which *.entity already
conforms.
>
> I hope this new explication is better,
>
> Regard;
>
> jeremie


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Convert emf model in xml [message #708916 is a reply to message #648807] Wed, 03 August 2011 09:29 Go to previous messageGo to next message
Till  is currently offline Till Friend
Messages: 3
Registered: August 2011
Junior Member
I have the same problem.

I am able to convert my ecore meta model to a standard xml schema. But my model instances that are conform to the ecore meta model are of course not conform to the xml schema. So i have to convert them anyhow.

Any hints?

Thanks a lot
Till
Re: Convert emf model in xml [message #709016 is a reply to message #708916] Wed, 03 August 2011 11:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
How are your serialized instances different from the one you'd expect
based on the exported schema?


On 03/08/2011 11:29 AM, Till wrote:
> I have the same problem.
>
> I am able to convert my ecore meta model to a standard xml schema. But
> my model instances that are conform to the ecore meta model are of
> course not conform to the xml schema. So i have to convert them anyhow.
>
> Any hints?
>
> Thanks a lot
> Till


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Convert emf model in xml [message #709067 is a reply to message #709016] Wed, 03 August 2011 13:20 Go to previous messageGo to next message
Till  is currently offline Till Friend
Messages: 3
Registered: August 2011
Junior Member
My main issue are the references that are using the EMF style instead of XPath
Re: Convert emf model in xml [message #709086 is a reply to message #709067] Wed, 03 August 2011 13:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Nothing is going to get it to use XPath. We can't even interpret Xpath
when we read the instance...


On 03/08/2011 3:20 PM, Till wrote:
> My main issue are the references that are using the EMF style instead
> of XPath


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Convert emf model in xml [message #709188 is a reply to message #709086] Wed, 03 August 2011 15:57 Go to previous message
Till  is currently offline Till Friend
Messages: 3
Registered: August 2011
Junior Member
Yea, that was what i thought. It's really a problem to read instances with other languages like C++ since no XML parser understands the references correctly.
Previous Topic:EMF and GEF
Next Topic:[CDO] V3 a problem and inefficient
Goto Forum:
  


Current Time: Sat Apr 27 03:27:01 GMT 2024

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

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

Back to the top