Skip to main content



      Home
Home » Modeling » EMF » Import other ecore model in XSD definition file(Import other ecore model in XSD definition file)
Import other ecore model in XSD definition file [message #850557] Fri, 20 April 2012 02:12 Go to next message
Eclipse UserFriend
Hi, I defined two Ecore models, one(call A) is from XSD and the other(call B) is built by native Ecore editor, they are placed in the same EMF project.

Now I want reference some interfaces from model B in model A xsd file, assumed that the NS-URI of model B is "http://a.b.c/emf/B", so I wrote it down as below:

...
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:ic="http://a.b.c/emf/B"
elementFormDefault="qualified" ecore:package=a" ecore:nsPrefix="a">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
<xs:import namespace="http://www.eclipse.org/emf/2002/Ecore" schemaLocation="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd"/>
...

<xs:complexType name="OneClass" ecore:implements="ic:IIdentified">
.....

then I create a genmodel for this XSD, it will produce Ecore A, but I found there's no super type for type "OneClass", did I missed something?

Thanks for you great help!

Re: Import other ecore model in XSD definition file [message #850578 is a reply to message #850557] Fri, 20 April 2012 02:33 Go to previous message
Eclipse UserFriend
David,

Comments below.

On 20/04/2012 8:12 AM, David BY Chan wrote:
> Hi, I defined two Ecore models, one(call A) is from XSD and the
> other(call B) is built by native Ecore editor, they are placed in the
> same EMF project.
>
> Now I want reference some interfaces from model B in model A xsd file,
It would have seemed better to define A with a schema.
> assumed that the NS-URI of model B is "http://a.b.c/emf/B", so I wrote
> it down as below:
>
> ..
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:ic="http://a.b.c/emf/B" elementFormDefault="qualified"
> ecore:package=a" ecore:nsPrefix="a">
> <xs:import namespace="http://www.w3.org/XML/1998/namespace" />
> <xs:import namespace="http://www.eclipse.org/emf/2002/Ecore"
> schemaLocation="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd"/>
> ..
>
> <xs:complexType name="OneClass" ecore:implements="ic:IIdentified">
Where is your import for the namespace defined in xmlns ic? Note you
can export B.ecore's GenModel to an XML Schema and you'll need to do
that if you want to refer to things it defines in other schemas.
> ....
>
> then I create a genmodel for this XSD, it will produce Ecore A, but I
> found there's no super type for type "OneClass", did I missed something?
Yes, the import for the schema that defines the model B.
>
> Thanks for you great help!
>
>
Previous Topic:[CDO][Urgent] tables not created..
Next Topic:Where's the mdl file(Rational Rose) for Ecore 2.7?
Goto Forum:
  


Current Time: Wed Jul 09 22:20:43 EDT 2025

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

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

Back to the top