Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:55 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
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 15:05 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
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 18:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
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: Fri Apr 26 12:03:29 GMT 2024

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

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

Back to the top