[ATL] XML extraction with ATL 3.0 [message #481315] |
Thu, 20 August 2009 09:10  |
Eclipse User |
|
|
|
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 #481853 is a reply to message #481784] |
Mon, 24 August 2009 10:50   |
Eclipse User |
|
|
|
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 #483696 is a reply to message #481856] |
Wed, 02 September 2009 11:50  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04890 seconds