Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-03-17 10:56:16 -0400
committerpelder2008-03-17 10:56:16 -0400
commitfbd1e17b2b776b5b01f082b9c6d891f72d67f453 (patch)
tree3a30407aa8068399c0233a51b8785f5786024304
parent4b93939df2dd54d9f2026076472be96c7e48c276 (diff)
downloadorg.eclipse.jet-fbd1e17b2b776b5b01f082b9c6d891f72d67f453.tar.gz
org.eclipse.jet-fbd1e17b2b776b5b01f082b9c6d891f72d67f453.tar.xz
org.eclipse.jet-fbd1e17b2b776b5b01f082b9c6d891f72d67f453.zip
[222951] XPath /* returns elements of a group in the wrong order on EMF/XML models
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
index 1199816..8dc6477 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
@@ -48,6 +48,7 @@ import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil;
import org.eclipse.jet.internal.l10n.JET2Messages;
import org.eclipse.jet.xpath.inspector.AddElementException;
import org.eclipse.jet.xpath.inspector.CopyElementException;
@@ -506,7 +507,8 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
if (isXMLNode(eClass))
{
- switch (getExtendedMetaData(eObject).getContentKind(eClass))
+ final ExtendedMetaData exMD = getExtendedMetaData(eObject);
+ switch (exMD.getContentKind(eClass))
{
case ExtendedMetaData.UNSPECIFIED_CONTENT:
case ExtendedMetaData.EMPTY_CONTENT:
@@ -514,14 +516,20 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
return EMPTY_ARRAY;
case ExtendedMetaData.ELEMENT_ONLY_CONTENT:
{
- final List allElementsFeatures = getExtendedMetaData(eObject).getAllElements(eClass);
+ final List allElementsFeatures = exMD.getAllElements(eClass);
List result = new ArrayList(allElementsFeatures.size());
for (Iterator i = allElementsFeatures.iterator(); i.hasNext();)
{
EStructuralFeature feature = (EStructuralFeature)i.next();
- switch (getExtendedMetaData(eObject).getFeatureKind(feature))
+ switch (exMD.getFeatureKind(feature))
{
case ExtendedMetaData.ELEMENT_FEATURE:
+ if(exMD.getGroup(feature) != null) {
+ // features a group will be retrived view the group feature
+ // (where they will occur in the document order)
+ // suppress them here.
+ break;
+ }
if (feature instanceof EAttribute)
{
if (eObject.eIsSet(feature))
@@ -568,7 +576,7 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
}
else
{
- result.add(eObject.eGet(entry.getEStructuralFeature()));
+ result.add(entry.getValue());
}
}
}
@@ -584,7 +592,7 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
}
case ExtendedMetaData.MIXED_CONTENT:
{
- EAttribute mixedFeature = getExtendedMetaData(eObject).getMixedFeature(eClass);
+ EAttribute mixedFeature = exMD.getMixedFeature(eClass);
FeatureMap featureMap = (FeatureMap)eObject.eGet(mixedFeature);
Object[] result = new Object [featureMap.size()];
int resultIndex = 0;

Back to the top