Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Does ecore only supports .xmi models?
Does ecore only supports .xmi models? [message #541972] Wed, 23 June 2010 08:28 Go to next message
Transformed is currently offline Transformed
Messages: 21
Registered: June 2010
Junior Member
Hi all,

I have source and target meta models and now I want to input my model as say "buildToBuilder.xml" as

Source Model IN:
           buildToBuilder.xml

and 

Target modle OUT:
      test.xml


Now I am wondering if the buildToBuilder.xml file should be in xmi format? otherwise I am getting errors like

Error loading platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'package' is not found or is abstract. (platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml, 2, 400)

Re: Does ecore only supports .xmi models? [message #542020 is a reply to message #541972] Wed, 23 June 2010 10:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070004000509050100000102
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

No, you should be able to read pretty much any XML format.

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/tutorials/xlibmod/xlibmod.html

Registering an appropriate factory is often important though.



Transformed wrote:
> Hi all,
>
> I have source and target meta models and now I want to input my model
> as say "buildToBuilder.xml" as
> Source Model IN:
> buildToBuilder.xml
>
> and
> Target modle OUT:
> test.xml
>
>
> Now I am wondering if the buildToBuilder.xml file should be in xmi
> format? otherwise I am getting errors like
> Error loading platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml:
> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'package' is
> not found or is abstract.
> (platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml, 2, 400)
>

--------------070004000509050100000102
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
No, you should be able to read pretty much any XML format. <br>
<blockquote><a
href=" http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/tutorials/xlibmod/xlibmod.html"> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/tutorials/xlibmod/xlibmod.html</a><br>
</blockquote>
 Registering an appropriate factory is often important though.<br>
<br>
<br>
<br>
Transformed wrote:
<blockquote cite="mid:hvsukq$gdj$1@build.eclipse.org" type="cite">Hi
all,
<br>
<br>
I have source and target meta models and now I want to input my model
as say "buildToBuilder.xml"  as <br>
Source Model IN:
<br>
          buildToBuilder.xml
<br>
<br>
and <br>
Target modle OUT:
<br>
     test.xml
<br>
<br>
<br>
Now I am wondering if the buildToBuilder.xml file should be in xmi
format? otherwise I am  getting errors like <br>
Error loading platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml:
org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'package' is
not found or is abstract.
(platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml, 2, 400)
<br>
<br>
</blockquote>
</body>
</html>

--------------070004000509050100000102--
Re: Does ecore only supports .xmi models? [message #542454 is a reply to message #542020] Thu, 24 June 2010 17:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4026
Registered: July 2009
Senior Member
Hi Hitindeep

Alternatively if you use a schema location to refer to your meta-model,
you may find that reflective/dynamic EMF works for you without needing
to generate Java models.

e.g. in buildToBuilder.xml

<mine:Ccc xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mine="mine" xsi:schemaLocation="mine My.ecore"/>

Regards

Ed Willink


On 23/06/2010 15:39, Ed Merks wrote:
> No, you should be able to read pretty much any XML format.
>
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .emf.doc/tutorials/xlibmod/xlibmod.html
>
> Registering an appropriate factory is often important though.
>
>
>
> Transformed wrote:
>> Hi all,
>>
>> I have source and target meta models and now I want to input my model
>> as say "buildToBuilder.xml" as
>> Source Model IN:
>> buildToBuilder.xml
>>
>> and
>> Target modle OUT:
>> test.xml
>>
>>
>> Now I am wondering if the buildToBuilder.xml file should be in xmi
>> format? otherwise I am getting errors like
>> Error loading platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml:
>> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'package' is
>> not found or is abstract.
>> (platform:/resource/WSCDL2SWBPEL/BuildToOrder.xml, 2, 400)
>>
Re: Does ecore only supports .xmi models? [message #542682 is a reply to message #542454] Fri, 25 June 2010 11:37 Go to previous messageGo to next message
Transformed is currently offline Transformed
Messages: 21
Registered: June 2010
Junior Member
I tried the ways and some of the other issues appeared.

I derived the metamodels from respective xsd file and I added
Quote:
<mine:Ccc xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mine="mine" xsi:schemaLocation="mine My.ecore"/>

.

When I try to open the xml file using the reflective ecore editor then again same error appeared as:

Quote:

PackageNotFoundException: package with uri "null" not found.
PackageNotFoundException: Class "Package" is not found of is abstract.



Does it make difference if I have Package in wscdl.ecore file and package in xml file?

Like in ecore file I have this.

Quote:

<eClassifiers xsi:type="ecore:EClass" name="Package" eSuperTypes="#//ExtensibleElements">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="tPackage"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>




and in input model I have

Quote:

<package xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.w3.org/2005/10/cdl CDL.ecore" xmlns:cdl="http://www.w3.org/2005/10/cdl" author="Ravi Khadka" name="BuildToOrderCDL" targetNamespace="http://example.org/build2order" version="x">


</package>

Re: Does ecore only supports .xmi models? [message #542701 is a reply to message #542682] Fri, 25 June 2010 12:24 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4026
Registered: July 2009
Senior Member
Hi

You need to define the namespace for "package", either by perhaps

<cdl:package xmlns:cdl="http://www.w3.org/2005/10/cdl"

or

<package xmlns="http://www.w3.org/2005/10/cdl"

Regards

Ed Willink

On 25/06/2010 16:37, Transformed wrote:
> I tried the ways and some of the other issues appeared.
>
> I derived the metamodels from respective xsd file and I added Quote:
>> <mine:Ccc xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:mine="mine" xsi:schemaLocation="mine My.ecore"/>
>
>
> When I try to open the xml file using the reflective ecore editor then
> again same error appeared as:
>
> Quote:
>> PackageNotFoundException: package with uri "null" not found.
>> PackageNotFoundException: Class "Package" is not found of is abstract.
>
>
> Does it make difference if I have Package in wscdl.ecore file and
> package in xml file?
>
> Like in ecore file I have this.
>
> Quote:
>> <eClassifiers xsi:type="ecore:EClass" name="Package"
>> eSuperTypes="#//ExtensibleElements">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="tPackage"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>
>
>
> and in input model I have
>
> Quote:
>> <package xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation = "http://www.w3.org/2005/10/cdl CDL.ecore"
>> xmlns:cdl="http://www.w3.org/2005/10/cdl" author="Ravi Khadka"
>> name="BuildToOrderCDL"
>> targetNamespace="http://example.org/build2order" version="x">
>>
>>
>> </package>
>
Previous Topic:[ATL] problem with am3 and using ant
Next Topic:[QVT-R] public2private example ?
Goto Forum:
  


Current Time: Thu Aug 21 18:14:00 EDT 2014

Powered by FUDForum. Page generated in 0.01721 seconds