Bug 208977 - Values of Multiplicity Many attribute ignored in EMF to JET mapping
Summary: Values of Multiplicity Many attribute ignored in EMF to JET mapping
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Jet (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2007-11-07 01:42 EST by Jörn Guy Süß CLA
Modified: 2020-05-01 16:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>