Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 06:12 Go to next message
David BY Chan is currently offline David BY ChanFriend
Messages: 40
Registered: July 2009
Member
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 06:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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!
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO][Urgent] tables not created..
Next Topic:Where's the mdl file(Rational Rose) for Ecore 2.7?
Goto Forum:
  


Current Time: Sat Apr 27 01:56:57 GMT 2024

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

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

Back to the top