Skip to main content



      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 04:59 Go to next message
Eclipse UserFriend
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.

[Updated on: Tue, 18 June 2013 07:56] by Moderator

Solve [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064260 is a reply to message #1064202] Tue, 18 June 2013 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

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

Best regard, Víctor.
Re: [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064271 is a reply to message #1064202] Tue, 18 June 2013 10:03 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: [ATL] Wrong XML output with EMF metamodel conform XSD [message #1064397 is a reply to message #1064271] Wed, 19 June 2013 01:41 Go to previous message
Eclipse UserFriend
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

Previous Topic:transformation with multiple inputs
Next Topic:EMFTVM - Sequences
Goto Forum:
  


Current Time: Tue Jul 22 18:06:25 EDT 2025

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

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

Back to the top