Bug 208977

Summary: Values of Multiplicity Many attribute ignored in EMF to JET mapping
Product: z_Archived Reporter: Jörn Guy Süß <jgsuess>
Component: JetAssignee: Project Inbox <m2t.jet-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: mats86_dif, patrik.jansson
Version: unspecifiedKeywords: core
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Jörn Guy Süß CLA 2007-11-07 01:42:49 EST
For a multiplicity-many eAttribute attr of an instance of eClass class, with
any number of entries above one, the following xpath expression ALWAYS
results in 1, when it should provide the number of attribute nodes. This is due to the fact XML attributes only hold single values. Hence, the EMF model loader must implicitly transform from an attribute to a reference. 

<c:get select="count($instance/@attr)"/>

This also means that iteration over the ignored nodes is not possible.

Further, you can observe that the bug is in the model loader, as any

<c:dump select="$instance"/>

will only show the first value of attr, rather than the whole set. 

The patch below has been suggested, but does not help with this:

<eStructuralFeatures xsi:type="ecore:EAttribute" name="attr" unique="false"
        upperBound="-1" eType="ecore:EDataType 
http://www.eclipse.org/emf/2003/XMLType#//String">
     <!-- start of hack --!>
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="kind" value="element"/>
      </eAnnotations>
     <!-- end of heck --!>
    </eStructuralFeatures>