|
Re: Import other ecore model in XSD definition file [message #850578 is a reply to message #850557] |
Fri, 20 April 2012 06:33 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.03914 seconds