Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] XML extraction with ATL 3.0
[ATL] XML extraction with ATL 3.0 [message #481315] Thu, 20 August 2009 13:10 Go to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
I'm trying to extract an XML based model to XML text. I had assumed this
feature worked in ATL 3 but i'm getting the following error.

C:\eclipse3.5Release\workspace\BNET-IP\build.xml:18: Unable to load
extractor xml

My ant file is as follows...

<project name="TransformAtoB" default="trans">
<property name="atl.launcher" value="EMF-specific VM" />
<target name="trans">

<atl.loadModel modelHandler="EMF" name="MP" metamodel="MOF"
path="MP.ecore"/>
<atl.loadModel modelHandler="EMF" name="XML" metamodel="MOF"
path="XML.ecore"/>
<atl.loadModel modelHandler="EMF" name="neModel" metamodel="MPDSL"
path="My.mpdsl"/>

<!--<atl.loadModel modelHandler="EMF" name="xmlModel" metamodel="MOF"
path="out.ecore"/>-->

<atl.launch path="MP_DSL2XML.asm">
<inmodel name="MP" model="MP"/>
<inmodel name="XML" model="XML"/>
<inmodel name="IN" model="neModel"/>
<outModel name="OUT" model="xmlModel" metamodel="XML"/>
</atl.launch>
<atl.saveModel model="xmlModel" path="x.out">
<extractor name="xml"></extractor>
</atl.saveModel>
</target>
</project>

Am I missing something obvious?
Cheers,
Ronan
Re: [ATL] XML extraction with ATL 3.0 [message #481784 is a reply to message #481315] Mon, 24 August 2009 10:18 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Ronan a écrit :
> Hi,
> I'm trying to extract an XML based model to XML text. I had assumed this
> feature worked in ATL 3

That's the point... at this time there is no XML extractor embedded into
ATL, as the XML metamodel you (probably) use was historically provided
by AM3 plugins.

There are several ways to generate XML from ATL: write your own
extractor using ATL 3.0 API, or simply use EMF XSD to generate a
metamodel from the XML Schema.

Best regards,

William

but i'm getting the following error.
>
> C:\eclipse3.5Release\workspace\BNET-IP\build.xml:18: Unable to load
> extractor xml
>
> My ant file is as follows...
>
> <project name="TransformAtoB" default="trans">
> <property name="atl.launcher" value="EMF-specific VM" />
> <target name="trans">
>
> <atl.loadModel modelHandler="EMF" name="MP" metamodel="MOF"
> path="MP.ecore"/>
> <atl.loadModel modelHandler="EMF" name="XML" metamodel="MOF"
> path="XML.ecore"/>
> <atl.loadModel modelHandler="EMF" name="neModel"
> metamodel="MPDSL" path="My.mpdsl"/>
>
> <!--<atl.loadModel modelHandler="EMF" name="xmlModel"
> metamodel="MOF" path="out.ecore"/>-->
>
> <atl.launch path="MP_DSL2XML.asm">
> <inmodel name="MP" model="MP"/>
> <inmodel name="XML" model="XML"/>
> <inmodel name="IN" model="neModel"/>
> <outModel name="OUT" model="xmlModel" metamodel="XML"/>
> </atl.launch>
> <atl.saveModel model="xmlModel" path="x.out">
> <extractor name="xml"></extractor>
> </atl.saveModel>
> </target>
> </project>
>
> Am I missing something obvious?
> Cheers,
> Ronan
>
Re: [ATL] XML extraction with ATL 3.0 [message #481853 is a reply to message #481784] Mon, 24 August 2009 14:50 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hey William,
Thanks for that. Would it be possible to say this is not implemented in
the wiki handbook as i'm sure many other people will hit this problem.

I'm trying out your second solution. However, if I create a model
conforming to the EMF XSD I won't have control over how it is formatted as
precisely as I would with the old XML.ecore based approach. For example
namespaces will be used and element names will look different e.g.
ModelType instead of Model. I need very fine grained control over how the
XML will look for interoperability.
Cheers,
Ronan

William Piers wrote:

> Hello,

> Ronan a écrit :
>> Hi,
>> I'm trying to extract an XML based model to XML text. I had assumed this
>> feature worked in ATL 3

> That's the point... at this time there is no XML extractor embedded into
> ATL, as the XML metamodel you (probably) use was historically provided
> by AM3 plugins.

> There are several ways to generate XML from ATL: write your own
> extractor using ATL 3.0 API, or simply use EMF XSD to generate a
> metamodel from the XML Schema.

> Best regards,

> William

> but i'm getting the following error.
>>
>> C:eclipse3.5ReleaseworkspaceBNET-IPbuild.xml:18: Unable to load
>> extractor xml
>>
>> My ant file is as follows...
>>
>> <project name="TransformAtoB" default="trans">
>> <property name="atl.launcher" value="EMF-specific VM" />
>> <target name="trans">
>>
>> <atl.loadModel modelHandler="EMF" name="MP" metamodel="MOF"
>> path="MP.ecore"/>
>> <atl.loadModel modelHandler="EMF" name="XML" metamodel="MOF"
>> path="XML.ecore"/>
>> <atl.loadModel modelHandler="EMF" name="neModel"
>> metamodel="MPDSL" path="My.mpdsl"/>
>>
>> <!--<atl.loadModel modelHandler="EMF" name="xmlModel"
>> metamodel="MOF" path="out.ecore"/>-->
>>
>> <atl.launch path="MP_DSL2XML.asm">
>> <inmodel name="MP" model="MP"/>
>> <inmodel name="XML" model="XML"/>
>> <inmodel name="IN" model="neModel"/>
>> <outModel name="OUT" model="xmlModel" metamodel="XML"/>
>> </atl.launch>
>> <atl.saveModel model="xmlModel" path="x.out">
>> <extractor name="xml"></extractor>
>> </atl.saveModel>
>> </target>
>> </project>
>>
>> Am I missing something obvious?
>> Cheers,
>> Ronan
>>
Re: [ATL] XML extraction with ATL 3.0 [message #481856 is a reply to message #481853] Mon, 24 August 2009 15:02 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Actually an example is as follows...

Using ATL I get:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Mp:DocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:Mp="platform:/resource/BNET-Transformation/target.xsd ">
<models>
<mix/>
</models>
</Mp:DocumentRoot>

but I want...
<?xml version="1.0" encoding="ISO-8859-1"?>
<models>
<mix/>
</models>

So I want to surpress the outputting of the XSD holder element
DocumentRoot. I'm sure this is a common question, but couldn't find a
solution as i'm used to the AM3 way of doing this :(
Thanks,
Ronan
Re: [ATL] XML extraction with ATL 3.0 [message #483696 is a reply to message #481856] Wed, 02 September 2009 15:50 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi guys,
I'm still working on this. I have looked at the Ecore/XSD mapping, so I
tried to influence the naming of the root element using the
ExtendedMetaData attribute name->xxx, where xxx is the desired name for
the XML element. It would seem that ATL pays no attention to this
approach, although a genertaed default Ecore based on such a metamodel
editor does.

Is there any way to influence this root element naming in ATL, without
building an XML extractor?

Cheers,
Ronan

Ronan wrote:

> Actually an example is as follows...

> Using ATL I get:

> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Mp:DocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:Mp="platform:/resource/BNET-Transformation/target.xsd ">
> <models>
> <mix/>
> </models>
> </Mp:DocumentRoot>

> but I want...
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <models>
> <mix/>
> </models>

> So I want to surpress the outputting of the XSD holder element
> DocumentRoot. I'm sure this is a common question, but couldn't find a
> solution as i'm used to the AM3 way of doing this :(
> Thanks,
> Ronan
Previous Topic:[ATL] problem while saving output model
Next Topic:[QVTO] Integrating of QVT Editor in my RCP Application
Goto Forum:
  


Current Time: Fri Apr 19 01:50:57 GMT 2024

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

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

Back to the top