Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] Annotation and XML attribute vs element(deserialization from xml)
[TEXO] Annotation and XML attribute vs element [message #632764] Thu, 14 October 2010 08:29 Go to next message
Jean Duracel is currently offline Jean DuracelFriend
Messages: 10
Registered: October 2010
Junior Member
Dear reader,

My ecore contains
<eStructuralFeatures xsi:type="ecore:EAttribute" name="nom" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
</eStructuralFeatures>

which produce me an attribute called nom inside my xml. When reading with ModelXMLLoader it works.

Instead of getting an attribute, i need an element :
<eStructuralFeatures xsi:type="ecore:EAttribute" name="nom" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="nom"/>
</eAnnotations>
</eStructuralFeatures>

The annotation produces an element called nom when serialized with ModelXMLSaver.

But when I use XMLModelLoader for this new xml, I get an error :
Feature 'nom' not found

Any idea ?

Thanks for your comment.
Re: [TEXO] Annotation and XML attribute vs element [message #632765 is a reply to message #632764] Thu, 14 October 2010 08:31 Go to previous message
Jean Duracel is currently offline Jean DuracelFriend
Messages: 10
Registered: October 2010
Junior Member
Well it seems that it was related to the namespace in use.

I had to add to the annotation:
<details key="namespace" value="##targetNamespace"/>

Thanks for you comment.
Previous Topic:[MWE2] Overview of existing MWE2 components and other documentation
Next Topic:[TEXO] XML serialization for arraylist
Goto Forum:
  


Current Time: Sat Mar 30 04:16:44 GMT 2024

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

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

Back to the top