[ATL] XML extractor [message #629500] |
Tue, 28 September 2010 14:01 |
Dave 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 |
Vincent MAHE 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03297 seconds