[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Problem XML serialization

Ed Merks wrote:
Ander,

You'll want to add an annotation to the package to indicate it's like a no namespace schema:
<http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchemaToEcoreMapping.pdf>



http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchemaToEcoreMapping.pdf


aZubi wrote:
Hello,

I have defined a simple metamodel using Ecore and I have generated the plugins. When I create a model conforming to that metamodel, the serialized thext looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Library xmlns="http://sLibMM"; xmlns:_="" _:name="theLibrary">
  <Book ref="1" available="no">
    <title>myBook</title>
    <author>me</author>
  </Book>
  <Book ref="2" available="no">
    <title>yourBook</title>
    <author>you</author>
  </Book>
</Library>

And I would like it to be:

<?xml version="1.0" encoding="UTF-8"?>
<Library name="theLibrary">
  <Book ref="1" available="no">
    <title>myBook</title>
    <author>me</author>
  </Book>
  <Book ref="2" available="no">
    <title>yourBook</title>
    <author>you</author>
  </Book>
</Library>

That is, I don't want the xmlns attribute in my XML.
Any idea how can I do it?

I attach my Ecore metamodel.

Thanks in advance.

Ander

Hello,

Thank you for your answer. I have been trying in different ways, but I didn't get to the result I want.

Do I have to create a DocumentRoot class in my metamodel? I haven't generated the metamodel from a XML Schema.

Ander