|
|
|
Re: ecore package with multiple namespaces [message #760126 is a reply to message #760113] |
Thu, 01 December 2011 12:02 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Markus,
Comments below.
On 01/12/2011 12:02 PM, Markus Stier wrote:
> Ed,
>
> this was the missing link. Thank you very much.
>
> I've changed the following methods in the generated editor according
> to
> http..//rodion-en.blogspot.com/2009/03/emf-editors-generate-xml-files-without.html
> and now my XML contains my namespaces. Abbreviated description of
> changes:
>
> in method createModel():
> replace
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
>
> with
> resource = editingDomain.getResourceSet().createResource(resourceURI);
> Map loadOptions = new HashMap();
> loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, true);
> resource.load(loadOptions);
> in method doSave(IProgressMonitor progressMonitor):
> add saveOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, true);
Better would be to specialize the resource factory and add these options
to the implementation...
>
> below
> saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
> Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
>
> One thing remains:
> If I export my ecore model with the _XML Schema_ exporter, my
> namespaces are used as expected. The _XML Schema for XMI_ exporter
> ignores the additional namespaces.
XMI schemas are essentially useless noise in my opinion. That exporter
was written long ago and doesn't take extended meta data into account...
>
> Best Markus
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01875 seconds