[ATL] Converting XML to EMF/Ecore-based Language [message #72838] |
Fri, 18 January 2008 21:27 |
Eclipse User |
|
|
|
Originally posted by: goetz.botterweck.lero.ie
Hi all,
let's assume I have the following two file formats:
INPUT - Plain XML
As an input I've got a plain XML file. The language structure is
described with a given XMLSchema. From this I can derive an Ecore
meta-model by using EMF's import function.
OUTPUT - XMI
For the output I've defined my own domain-specific language with Ecore,
which is roughly 1-to-1 equivalent to the input language, but was
cleaned up a bit. As usual, instance of this meta-model are saved by EMF
in XMI format.
GOAL
Now I would like to convert a given plain XML file into the XMI format
which is an instance of my handcrafted ECore-Metamodel.
QUESTIONS
* Can I do this by using ATL?
* Is ATL able to read plain XML files, if I've got a corresponding
XMLSchema and (use EMF to) generate an equivalent Ecore-Metamodel
from it?
* If no, do you have other suggestions?
Thanks for any hints or comments,
Goetz
|
|
|
|
Re: [ATL] Converting XML to EMF/Ecore-based Language [message #72967 is a reply to message #72838] |
Mon, 21 January 2008 09:25 |
Eclipse User |
|
|
|
Originally posted by: Hugo.Bruneliere.univ-nantes.fr
Hi Goetz,
Goetz Botterweck a écrit :
> Hi all,
>
> let's assume I have the following two file formats:
>
> INPUT - Plain XML
> As an input I've got a plain XML file. The language structure is
> described with a given XMLSchema. From this I can derive an Ecore
> meta-model by using EMF's import function.
>
>
> OUTPUT - XMI
> For the output I've defined my own domain-specific language with Ecore,
> which is roughly 1-to-1 equivalent to the input language, but was
> cleaned up a bit. As usual, instance of this meta-model are saved by EMF
> in XMI format.
>
>
> GOAL
> Now I would like to convert a given plain XML file into the XMI format
> which is an instance of my handcrafted ECore-Metamodel.
>
>
> QUESTIONS
>
> * Can I do this by using ATL?
> * Is ATL able to read plain XML files, if I've got a corresponding
> XMLSchema and (use EMF to) generate an equivalent Ecore-Metamodel
> from it?
> * If no, do you have other suggestions?
>
Yes, you can do that using ATL (and we have already done that many
times). The process is composed of two different steps:
1 - Inject your XML document into an XML model (i.e. a model which
conforms to the XML metamodel) -> this can be automatically done
right-clicking on your XML document using the AM3 Resource Navigator
view provided with the AM3 plugins available in the ATL downloads
(http://www.eclipse.org/m2m/atl/download/).
2 - Write an XML2XXX ATL transformation with XXX your target metamodel
Note that you don't need your XML schema.
> Thanks for any hints or comments,
> Goetz
>
Best regards,
Hugo
--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.02789 seconds