Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: How to use ecore2xml?
Re: How to use ecore2xml? [message #480509] Mon, 17 August 2009 12:47 Go to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Mark,

This question is probably more appropriate for the EMF newsgroup (copied).

It's not really expected that Ecore2XML models be used as input to a
generator model... what were you looking to achieve? The original intent
of Ecore2XML models was to use them as input to a resource
implementation, to help drive the way resources are (de)serialized
to/from XML...

Kenn

Mark Hoffmann wrote:
> Hello,
>
> I have created an ecore2xml mapping. Now I want to make it work. Is it
> correct that ecore2xml only works with the resource type xml in my
> genmodel? How can I tell my genmodel to use the ecore2xml mapping? Is it
> even possible to give the genmodel the ecore2xml mapping?
>
> Mark
Re: How to use ecore2xml? [message #480523 is a reply to message #480509] Mon, 17 August 2009 13:56 Go to previous messageGo to next message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Kenn,

I new with EMF. I thought, I can give the genmodel the ecore2xml
mapping, so that this mapping will be automatically included into the
model code generation process. So the (de)serialization could always use
this mapping.

Currently I have a model that serializes like this:

<?xml version="1.0" encoding="UTF-8"?>
<print:article xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:print="print">
<articleinfo title="Testdocument">
<author firstname="Mark" surname="Hoffmann"/>
</larticleinfo>
<sect1 title="Introduction">
<para text="This my Introduction"/>
</sect1>
</print:article>

But I need it more in the docbook style:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN" "../docbook-xml-4.5/docbookx.dtd">
<article>
<articleinfo>
<title>Testdocument</title>
<author>
<firstname>Mark</firstname>
<surname>Hoffmann</surname>
</author>
</articleinfo>
<sect1>
<title>Introduction</title>
<para>This my Introduction</para>
</sect1>
</article>

At the moment I use xslt transformation to get the docbook style. I am
looking for way to avoid this step.

Mark

Kenn Hussey schrieb:
> Mark,
>
> This question is probably more appropriate for the EMF newsgroup (copied).
>
> It's not really expected that Ecore2XML models be used as input to a
> generator model... what were you looking to achieve? The original intent
> of Ecore2XML models was to use them as input to a resource
> implementation, to help drive the way resources are (de)serialized
> to/from XML...
>
> Kenn
>
> Mark Hoffmann wrote:
>> Hello,
>>
>> I have created an ecore2xml mapping. Now I want to make it work. Is it
>> correct that ecore2xml only works with the resource type xml in my
>> genmodel? How can I tell my genmodel to use the ecore2xml mapping? Is it
>> even possible to give the genmodel the ecore2xml mapping?
>>
>> Mark
Re: How to use ecore2xml? [message #480646 is a reply to message #480523] Tue, 18 August 2009 05:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Mark,

You should be able to use extended meta data annotations to accomplish
your goal. Try writing a small schema (or looking at the library schema
tutorial to see how they work). There's also an option for writing a
doctype.

Mark Hoffmann schrieb:
> Kenn,
>
> I new with EMF. I thought, I can give the genmodel the ecore2xml
> mapping, so that this mapping will be automatically included into the
> model code generation process. So the (de)serialization could always use
> this mapping.
>
> Currently I have a model that serializes like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <print:article xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:print="print">
> <articleinfo title="Testdocument">
> <author firstname="Mark" surname="Hoffmann"/>
> </larticleinfo>
> <sect1 title="Introduction">
> <para text="This my Introduction"/>
> </sect1>
> </print:article>
>
> But I need it more in the docbook style:
>
> <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC
> "-//OASIS//DTD DocBook XML V4.5//EN" "../docbook-xml-4.5/docbookx.dtd">
> <article>
> <articleinfo>
> <title>Testdocument</title>
> <author>
> <firstname>Mark</firstname>
> <surname>Hoffmann</surname>
> </author>
> </articleinfo>
> <sect1>
> <title>Introduction</title>
> <para>This my Introduction</para>
> </sect1>
> </article>
>
> At the moment I use xslt transformation to get the docbook style. I am
> looking for way to avoid this step.
>
> Mark
>
> Kenn Hussey schrieb:
>> Mark,
>>
>> This question is probably more appropriate for the EMF newsgroup (copied).
>>
>> It's not really expected that Ecore2XML models be used as input to a
>> generator model... what were you looking to achieve? The original intent
>> of Ecore2XML models was to use them as input to a resource
>> implementation, to help drive the way resources are (de)serialized
>> to/from XML...
>>
>> Kenn
>>
>> Mark Hoffmann wrote:
>>> Hello,
>>>
>>> I have created an ecore2xml mapping. Now I want to make it work. Is it
>>> correct that ecore2xml only works with the resource type xml in my
>>> genmodel? How can I tell my genmodel to use the ecore2xml mapping? Is it
>>> even possible to give the genmodel the ecore2xml mapping?
>>>
>>> Mark


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to use ecore2xml? [message #480698 is a reply to message #480646] Tue, 18 August 2009 09:10 Go to previous message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
I will try this. Thank you.

Mark

Ed Merks schrieb:
> Mark,
>
> You should be able to use extended meta data annotations to accomplish
> your goal. Try writing a small schema (or looking at the library schema
> tutorial to see how they work). There's also an option for writing a
> doctype.
>
> Mark Hoffmann schrieb:
>> Kenn,
>>
>> I new with EMF. I thought, I can give the genmodel the ecore2xml
>> mapping, so that this mapping will be automatically included into the
>> model code generation process. So the (de)serialization could always use
>> this mapping.
>>
>> Currently I have a model that serializes like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <print:article xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:print="print">
>> <articleinfo title="Testdocument">
>> <author firstname="Mark" surname="Hoffmann"/>
>> </larticleinfo>
>> <sect1 title="Introduction">
>> <para text="This my Introduction"/>
>> </sect1>
>> </print:article>
>>
>> But I need it more in the docbook style:
>>
>> <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC
>> "-//OASIS//DTD DocBook XML V4.5//EN" "../docbook-xml-4.5/docbookx.dtd">
>> <article>
>> <articleinfo>
>> <title>Testdocument</title>
>> <author>
>> <firstname>Mark</firstname>
>> <surname>Hoffmann</surname>
>> </author>
>> </articleinfo>
>> <sect1>
>> <title>Introduction</title>
>> <para>This my Introduction</para>
>> </sect1>
>> </article>
>>
>> At the moment I use xslt transformation to get the docbook style. I am
>> looking for way to avoid this step.
>>
>> Mark
>>
>> Kenn Hussey schrieb:
>>> Mark,
>>>
>>> This question is probably more appropriate for the EMF newsgroup
>>> (copied).
>>>
>>> It's not really expected that Ecore2XML models be used as input to a
>>> generator model... what were you looking to achieve? The original intent
>>> of Ecore2XML models was to use them as input to a resource
>>> implementation, to help drive the way resources are (de)serialized
>>> to/from XML...
>>>
>>> Kenn
>>>
>>> Mark Hoffmann wrote:
>>>> Hello,
>>>>
>>>> I have created an ecore2xml mapping. Now I want to make it work. Is it
>>>> correct that ecore2xml only works with the resource type xml in my
>>>> genmodel? How can I tell my genmodel to use the ecore2xml mapping?
>>>> Is it
>>>> even possible to give the genmodel the ecore2xml mapping?
>>>>
>>>> Mark
Previous Topic:DragAndDrop- or Move-Command Issue
Next Topic:[CDO] Problem with Getting started with CDO
Goto Forum:
  


Current Time: Fri Apr 19 07:25:38 GMT 2024

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

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

Back to the top