XSD to ecore [message #422594] |
Wed, 10 September 2008 14:21  |
Eclipse User |
|
|
|
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 15:45  |
Eclipse User |
|
|
|
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.
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03187 seconds