Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Converting XML to EMF/Ecore-based Language
[ATL] Converting XML to EMF/Ecore-based Language [message #72838] Fri, 18 January 2008 21:27 Go to next message
Eclipse UserFriend
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 #72949 is a reply to message #72838] Mon, 21 January 2008 09:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------050500070802000004000800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Goetz,

From the description if your use case, I suggest you to use the
XMLInjector.
Please read the following:
http://wiki.eclipse.org/index.php/ATL_Howtos#How_can_I_handl e_arbitrary_XML_documents.3F

Regards,

Quentin

Goetz Botterweck a
Re: [ATL] Converting XML to EMF/Ecore-based Language [message #72967 is a reply to message #72838] Mon, 21 January 2008 09:25 Go to previous message
Eclipse UserFriend
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/
--------------------------------------------------------
Previous Topic:multiple pattern matching with resolveTemp
Next Topic:Problem with for
Goto Forum:
  


Current Time: Sun Apr 11 22:54:54 GMT 2021

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

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

Back to the top