Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Use XSD Metamodel in ATL
Use XSD Metamodel in ATL [message #1021253] Tue, 19 March 2013 18:39 Go to next message
Arnedo Ramon is currently offline Arnedo RamonFriend
Messages: 14
Registered: March 2012
Junior Member

I am trying to perform an ATL transformation from UML models to XML Schemas.
I am using the UML metamodel as IN metamodel, specifically, the uml.ecore included in the UML2 plug-in (org.eclipse.uml2.uml_3.2.100.v201108110105.jar).

I have transformed the file XMLSchema.xsd, provided in the XSD plug-in (org.eclipse.xsd_2.7.1.v20120130-0943.jar) within \cache\\2001, to an ecore metamodel, using the EMF plug-in.

If I use this metamodel as OUT metamodel in a very simple transformation (see below) I obtain this message in the ATL Logger: "Metamodel contains several classifiers with same name: AnyType". What does it mean? Only one Classifier AnyType is in the ecore file.

Which is the OUT metamodel that I should use?

Can I use an Uri? I tried to use, but it does not work. The error is: Error loading org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri '' not found. (, 1, 260)

The ATL transformation is:

module UML2XMLSchema;
create OUT : XMLSchema from IN : UML;

rule trClass {
c : UML!Class
t : XMLSchema!LocalComplexType (
name <- + 'Type'

Could anybody help me?

Thanks in advance!

Re: Use XSD Metamodel in ATL [message #1021764 is a reply to message #1021253] Wed, 20 March 2013 16:27 Go to previous message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 667
Registered: July 2009
Senior Member

The error you get means that you are loading a metamodel that is probably already loaded into the EMF Registry (this is why it can found several EClass with the same name).
When using already registered metamodels such as the UML2 one, I recommend you to load them using their URI when running transformations.
Note that you can also similarly benefit from the content assist:

If you want to use the URI of the Ecore metamodel you've generated from the XDS schema (i.e.; your own one and not the generic one you're mentioning in your post), your Ecore metamodel has to be previously registered/loaded into the EMF Registry.
Then you will be able to refer to it from your ATL transformation and corresponding launcher.

Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
Previous Topic:get the reference from EClass defined in a subpackage
Next Topic:exemple of condition in transformation ATL
Goto Forum:

Current Time: Thu May 24 00:49:30 GMT 2018

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

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

Back to the top