Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] probem with XML model
[ATL] probem with XML model [message #658857] Thu, 10 March 2011 05:24 Go to next message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Hi all,

I'm trying to write a very simple XML file that conforms to XML.ecore metamodel, but when I launched a configuration, it gave me this error:

Error loading platform:/resource/SequenceTest-Mar08-2011/source/parameters -1.xml: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Node' is not found or is abstract. (platform:/resource/SequenceTest-Mar08-2011/source/parameter s-1.xml, 3, 15)

This is the input model to ATL transformation
<?xml version="1.0" encoding="ASCII"?>
<Root xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="XML">
<children>
<children name = 'lifeLine' value = 'Cust'/>
<children name = 'message' value = 'list'/>
</children>
</Root>

This is the metamodel in km3 format, but I use the ecore one.
-- @name XML
-- @version 1.1
-- @domains XML
-- @description This metamodel defines a subset of Extensible Markup Language (XML) and particulary XML document. It describes an XML document composed of one root node. Node is an abstract class having two direct children, namely ElementNode and AttributeNode. ElementNode represents the tags, for example a tag named xml: <xml></xml>. ElementNodes can be composed of many Nodes. AttributeNode represents attributes, which can be found in a tag, for example the attr attribute: <xml attr="value of attr"/>. ElementNode has two sub classes, namely RootNode and TextNode. RootNode is the root element. The TextNode is a particular node, which does not look like a tag; it is only a string of characters.

package XML {
abstract class Node {
attribute startLine[0-1] : Integer;
attribute startColumn[0-1] : Integer;
attribute endLine[0-1] : Integer;
attribute endColumn[0-1] : Integer;
attribute name : String;
attribute value : String;
reference parent[0-1] : Element oppositeOf children;
}
class Attribute extends Node {}
class Text extends Node {}
class Element extends Node {
reference children[*] ordered container : Node oppositeOf parent;
}
class Root extends Element {}
}

package PrimitiveTypes {
datatype Boolean;
datatype Integer;
datatype String;
}

Does anyone know what is wrong with the XML file?

Thanks in advance,

Sally
Re: [ATL] probem with XML model [message #658959 is a reply to message #658857] Thu, 10 March 2011 14:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31770
Registered: July 2009
Senior Member
Sally,

Comments below.

Sally wrote:
> Hi all,
>
> I'm trying to write a very simple XML file that conforms to XML.ecore
> metamodel, but when I launched a configuration, it gave me this error:
>
> Error loading
> platform:/resource/SequenceTest-Mar08-2011/source/parameters -1.xml:
> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Node' is not
> found or is abstract.
> (platform:/resource/SequenceTest-Mar08-2011/source/parameter s-1.xml,
> 3, 15)
>
> This is the input model to ATL transformation
> <?xml version="1.0" encoding="ASCII"?>
> <Root xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="XML">
This doesn't look like XMI because the root element is qualified with
"XML" as the namespace. Maybe ATL is okay with that...
> <children>
Doesn't this need an xsi:type/xmi:type so that the parse knows which
subclass of Node to create. It can't create a Node because it's
abstract. The parser definitely seems to not be liking that.
> <children name = 'lifeLine' value = 'Cust'/>
> <children name = 'message' value = 'list'/>
> </children>
> </Root>
>
> This is the metamodel in km3 format, but I use the ecore one. --
> @name XML -- @version 1.1
> -- @domains XML
> -- @description This metamodel defines a subset of Extensible
> Markup Language (XML) and particulary XML document. It describes an
> XML document composed of one root node. Node is an abstract class
> having two direct children, namely ElementNode and AttributeNode.
> ElementNode represents the tags, for example a tag named xml:
> <xml></xml>. ElementNodes can be composed of many Nodes. AttributeNode
> represents attributes, which can be found in a tag, for example the
> attr attribute: <xml attr="value of attr"/>. ElementNode has two sub
> classes, namely RootNode and TextNode. RootNode is the root element.
> The TextNode is a particular node, which does not look like a tag; it
> is only a string of characters.
>
> package XML {
> abstract class Node {
> attribute startLine[0-1] : Integer;
> attribute startColumn[0-1] : Integer;
> attribute endLine[0-1] : Integer;
> attribute endColumn[0-1] : Integer;
> attribute name : String;
> attribute value : String;
> reference parent[0-1] : Element oppositeOf children;
> }
> class Attribute extends Node {}
> class Text extends Node {}
> class Element extends Node {
> reference children[*] ordered container : Node oppositeOf parent;
> }
> class Root extends Element {}
> }
>
> package PrimitiveTypes {
> datatype Boolean;
> datatype Integer;
> datatype String;
> }
>
> Does anyone know what is wrong with the XML file?
>
> Thanks in advance,
>
> Sally
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [ATL] probem with XML model [message #659212 is a reply to message #658857] Fri, 11 March 2011 15:05 Go to previous message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Thanks Ed. I actually tried this, but I still get the same error.
<children xsi:type= 'XML:Attribute' name = 'lifeLine' value = 'Cust'/>

I took this XML model and metamodel from the ATL examples, I'm trying now to write my XML metamodel in km3, then inject it to ecore metamodel, but I think a plugin is missing as when right click on the km3 file there is no icon to inject to ecore.

Does anyone know what plugin is needed to inject a km3 model to ecore metamodel. I'm using eclipse 3.5.2 and ATL 3.0.2

Thanks,

Sally
Previous Topic:Can't launch UML2OWL on ATL 3.1
Next Topic:[ATL] xsd->Ecore->ATL
Goto Forum:
  


Current Time: Mon Mar 01 13:42:50 GMT 2021

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

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

Back to the top