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
Hi,

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\www.w3.org\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 http://www.w3.org/2001/XMLSchema, but it does not work. The error is: Error loading http://www.w3.org/2001/XMLSchema: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.w3.org/1999/xhtml' not found. (http://www.w3.org/2001/XMLSchema, 1, 260)

The ATL transformation is:

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

rule trClass {
from
c : UML!Class
to
t : XMLSchema!LocalComplexType (
name <- c.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: 674
Registered: July 2009
Senior Member
Hello,

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: http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Tools#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, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
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: Fri Apr 26 07:00:09 GMT 2024

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

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

Back to the top