Skip to main content



      Home
Home » Modeling » EMF » How to suppress target namespace generation on xml resource serialization
How to suppress target namespace generation on xml resource serialization [message #1738788] Sun, 24 July 2016 09:55 Go to next message
Eclipse UserFriend
I have created an ecore meta model from an xsd which has the target namespace set.
Now, I would like to serialize an instance of the meta model (conforming to the xsd) but suppress generating the target namespace (which would not be conforming anymore, but that is ok).

As-is:

<ns:myTag xmlns:ns="http://xsd-target-namespace">
...
<ns:myTag>


Should be:

<myTag>
...
<myTag>


I could not find an option in XMLResource that seems to cover this.
Any other way to achieve this?

Thanks!
Re: How to suppress target namespace generation on xml resource serialization [message #1738791 is a reply to message #1738788] Sun, 24 July 2016 11:05 Go to previous messageGo to next message
Eclipse UserFriend
Found a solution by providing an ExtendedMetaData and overriding the getNamespace(*) methods of it to return null.
Re: How to suppress target namespace generation on xml resource serialization [message #1738796 is a reply to message #1738791] Sun, 24 July 2016 14:51 Go to previous message
Eclipse UserFriend
Erdal,

You could also do this with an annotation. Just generate an Ecore
model from a schema without a target namespace and you'll see what it
generates.


On 24.07.2016 17:05, Erdal Karaca wrote:
> Found a solution by providing an ExtendedMetaData and overriding the
> getNamespace(*) methods of it to return null.
Previous Topic:CDO and Walking EMF
Next Topic:[CDO] Information : New framework to use CDO as back storage for Graphiti diagrams
Goto Forum:
  


Current Time: Sat Jul 12 13:45:35 EDT 2025

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

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

Back to the top