Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [ATL] Wrong XML output with EMF metamodel conform XSD
[ATL] Wrong XML output with EMF metamodel conform XSD [message #1064202] Tue, 18 June 2013 08:59 Go to next message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Hello,

I have an EMF metamodel that I have generated conform an XSD file using the EMF wizard. I use the generated metamodel as target metamodel in an ATL transformation. I hope to obtain a file like that:
<?xml version="1.0" encoding="UTF-8"?>
<rest-config>
  <action-mappings/>
</rest-config>

The code that I paste before I the style of a model created using the EMF tree editor, of the metamodel that I generated.

But when I run the transformation I obtained an XMI file like that, when I set the file extension as *.xmi and *.xml in ATL run configuration:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:RestConfig="platform:/resource/rest/resource/rest-config.xsd">
  <RestConfig:RestConfigType>
     <RestConfig:ActionMappingsType/>
  <RestConfig:RestConfigType>
</xmi:XMI>


And when I set in the ATL configuration the output file extension as memtamodele extension (*.restconfig) and I obtain something like that:
<?xml version="1.0" encoding="ISO-8859-1"?>
<rest-config_._type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../rest/resource/rest-config.xsd" name="elemento">
  <action-mappings/>
<rest-config_._type/>


¿How can obtain that ATL give an output like EMF tree editor?

Best regard, Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Tue, 18 June 2013 11:56]

Report message to a moderator

Solve [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064260 is a reply to message #1064202] Tue, 18 June 2013 13:11 Go to previous messageGo to next message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Hello,

The problem was that I didn't generate the element "DocumentRoot". Now the output is a well-formed XML.

Best regard, Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064271 is a reply to message #1064202] Tue, 18 June 2013 14:03 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

ATL is built on top of EMF. So if you have your specific file extension properly registered with a given factory, EMF will be able to load/save your model as expected for ATL.
Otherwise, ATL supports by default (as EMF) the loading/saving of models in XMI format or from/to EMF URIs.

Note that the important part is that your are dealing with an EMF model when defining your transformation.
The fact that this model is then serialized into an XMI file or a textual file, saved into a database, etc. does not really matter at the transformation level.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064397 is a reply to message #1064271] Wed, 19 June 2013 05:41 Go to previous message
Victor Pavon is currently offline Victor PavonFriend
Messages: 50
Registered: April 2012
Location: Spain
Member
Hello Hugo,

thank you for the information. Finally I resolved the problem. It was that I forget generate the element "DocumentRoot" in the ATL transformation. Now it works properly.

Best regard, Víctor



Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Previous Topic:transformation with multiple inputs
Next Topic:EMFTVM - Sequences
Goto Forum:
  


Current Time: Fri Apr 19 14:55:29 GMT 2024

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

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

Back to the top