Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] XML extractor
[ATL] XML extractor [message #629500] Tue, 28 September 2010 14:01 Go to next message
Dave  is currently offline Dave Friend
Messages: 37
Registered: September 2010
Member
Hi all,

I would like to receive some clarification about XML extraction from an ATL project.
I need to write an XML output file from my transformation; this XML file must be conform to an ecore metamodel, correctly defined.

Actually, I'm able to obtain two situations in the XML file:

1) <?xml version="1.0" encoding="ISO-8859-1"?>
<DocumentRoot.........>
<project.....>
...
</project>
</DocumentRoot>

2) <?xml version="1.0" encoding="ISO-8859-1"?>
<ProjectType........>
...
</ProjectType>

Both the situations are incorrect, because what I would like to obtain is something similar to:

<?xml version="1.0" encoding="ISO-8859-1"?>
<project...>
...
</project>

I think I must use an XML extractor, so I've added the following line to the "saveModel" tag of the ant build file:

<extractor name="XML">

but it doesn't work, because, even if the tranformation is successfully executed and terminated, the XML file is not written.
So, I've also downloaded a basical XML extractor implemented by means of a Java class, but refferring it in the build file through the line <extractor name="${extractor.filebasename}.java">, I obtain the same result.

Anyone can help me, please?

Thanks in advance,
Dave.
Re: [ATL] XML extractor [message #629543 is a reply to message #629500] Tue, 28 September 2010 15:59 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 28/09/2010 16:01, Dave a écrit :
> Hi all,
>
> I would like to receive some clarification about XML extraction from an
> ATL project.
> I need to write an XML output file from my transformation; this XML file
> must be conform to an ecore metamodel, correctly defined.
>
> Actually, I'm able to obtain two situations in the XML file:
>
> 1) <?xml version="1.0" encoding="ISO-8859-1"?>
> <DocumentRoot.........>
> <project.....>
> ...
> </project>
> </DocumentRoot>
>
> 2) <?xml version="1.0" encoding="ISO-8859-1"?>
> <ProjectType........>
> ...
> </ProjectType>
>
> Both the situations are incorrect, because what I would like to obtain
> is something similar to:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project...>
> ...
> </project>
>
> I think I must use an XML extractor, so I've added the following line to
> the "saveModel" tag of the ant build file:
>
> <extractor name="XML">
>
> but it doesn't work, because, even if the tranformation is successfully
> executed and terminated, the XML file is not written.
> So, I've also downloaded a basical XML extractor implemented by means of
> a Java class, but refferring it in the build file through the line
> <extractor name="${extractor.filebasename}.java">, I obtain the same
> result.
>
> Anyone can help me, please?
>
> Thanks in advance,
> Dave.

You have to proceed by two steps:
(1) obtain a model of the targeted domain (the content of the XML
file) which conforms to the corresponding DSL
(2) transform this domain model into a XML model (the syntax or form)
which conforms to the XML metamodel (mainly, this model is constituted
of Elements and Attributes, with "children" containments).

It is this XML model that the XML extractor can transform into the XML
textual file. So you need to write the semantic transformation between
your domain and the XML corresponding syntax (the one expressed in a DSD
or a XSD).

You may have a look on the Excel examples of the ATL zoo.
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: [ATL] XML extractor [message #629679 is a reply to message #629543] Wed, 29 September 2010 08:38 Go to previous messageGo to next message
Dave  is currently offline Dave Friend
Messages: 37
Registered: September 2010
Member
Thanks for your reply, from which I understand that, assuming I'm able to obtain an XML file conform to a metamodel defined by means of ecore, I need to launch another transformation for mapping that XML file on the XML metamodel. So, I must create a second transformation, am I right?

Many thanks,
Dave.
Re: [ATL] XML extractor [message #629726 is a reply to message #629679] Wed, 29 September 2010 10:55 Go to previous message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 29/09/2010 10:38, Dave a écrit :
> Thanks for your reply, from which I understand that, assuming I'm able
> to obtain an XML file conform to a metamodel defined by means of ecore,
> I need to launch another transformation for mapping that XML file on the
> XML metamodel. So, I must create a second transformation, am I right?
>
> Many thanks,
> Dave.
Yes.
DSL1 model <ATL> DSL2 model <ATL> XML model <extractor> XML textual file
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Previous Topic:[QVTO] Black box queries in org.eclipse.m2m.qvt.oml_1.0.1
Next Topic:[QVTo] Extracting information from extendedMetaData
Goto Forum:
  


Current Time: Mon Jun 17 16:33:59 GMT 2019

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

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

Back to the top