Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD to ecore
XSD to ecore [message #422594] Wed, 10 September 2008 18:21 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
is there a way to automate some of the manual operations of generating the
ecore and genmodel files from an existing XSD file. Here are the things we
would like to accomplish that are currently performed manually.

1)specify the the value of nsURI in the generated .ecore file inside the
..XSD , much like how we already specify either ecore:nsPrefix or
ecore:package (ie. ecore.nsURI) (I do not want to use targetnamespace to do
this, since I already
2)specify the copyrightText in the XSD (copyrightFields = true) so that we
do not need to manually override this each time the .genmodel is created.


-- remove TheSchema.ecore from file system
-- remove TheSchema.genmodel from file system
-- refresh project
-- generate TheSchema.xsd -> TheSchema.genmodel
-- Modify TheSchema.ecore nsURI = file://ROOT/etc/TheSchema.xsd
-- remove TheSchema.genmodel from file system
-- refresh project
-- generate TheSchema.ecore ->TheSchema.genmodel
-- modify TheSchema.genmodel, copyrightFields = true, copyrightText = The
copyright text
Re: XSD to ecore [message #422596 is a reply to message #422594] Wed, 10 September 2008 19:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30813
Registered: July 2009
Senior Member
Drew,

Comments below.

drew wrote:
> is there a way to automate some of the manual operations of generating the
> ecore and genmodel files from an existing XSD file. Here are the things we
> would like to accomplish that are currently performed manually.
>
> 1)specify the the value of nsURI in the generated .ecore file inside the
> .XSD ,
That's normally done via the target namespace of the schema. I recently
added support for ecore:nsURI but that only applies for null
targetNamespace schemas
> much like how we already specify either ecore:nsPrefix or
> ecore:package (ie. ecore.nsURI) (I do not want to use targetnamespace to do
> this, since I already
>
It's inconceivable to me that you'd want an nsURI that's different from
the targetNamespace, so I assume you have a null target namespace schema...
> 2)specify the copyrightText in the XSD (copyrightFields = true) so that we
> do not need to manually override this each time the .genmodel is created.
>
>
> -- remove TheSchema.ecore from file system
> -- remove TheSchema.genmodel from file system
>
Why? Oh, I guess because you've changed the nsURI of the package so you
can't do a Reload...
> -- refresh project
> -- generate TheSchema.xsd -> TheSchema.genmodel
> -- Modify TheSchema.ecore nsURI = file://ROOT/etc/TheSchema.xsd
> -- remove TheSchema.genmodel from file system
> -- refresh project
> -- generate TheSchema.ecore ->TheSchema.genmodel
> -- modify TheSchema.genmodel, copyrightFields = true, copyrightText = The
> copyright text
>
Until you can work with EMF 2.5's support for ecore:nsURI, you might
want to create a new GenModel and Ecore model with different names from
your existing ones, and then copy the new .ecore to the old .ecore
location/name while changing the nsURI. That way you avoid quite a few
steps, including the copyright settings in the GenModel.
>
>
>
>
Previous Topic:[CDO] Transparent CDO integration into generated EMF editor
Next Topic:[emf-dev] cannot add type parameter to a class in EMF
Goto Forum:
  


Current Time: Sat Jan 25 10:24:00 GMT 2020

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

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

Back to the top