Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-04-07 11:11:10 -0400
committerpelder2008-04-07 11:11:10 -0400
commit3280930e23f7914775ba4b24e8467f5e72829dfb (patch)
treeb0a5b1b9798b2ba88d48e76dae36f05f0f5c8726
parent2518144ff51c4c52632b13b982787bf5f0ffd2ec (diff)
downloadorg.eclipse.jet-3280930e23f7914775ba4b24e8467f5e72829dfb.tar.gz
org.eclipse.jet-3280930e23f7914775ba4b24e8467f5e72829dfb.tar.xz
org.eclipse.jet-3280930e23f7914775ba4b24e8467f5e72829dfb.zip
[225962] XPath expressions fail to find some features in XSD-based EMF models
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java7
1 files changed, 5 insertions, 2 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 8dc6477..f5282ab 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,7 +48,6 @@ 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;
@@ -737,6 +736,7 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
EStructuralFeature feature = (EStructuralFeature)i.next();
final int featureKind = exMD.getFeatureKind(feature);
if(featureKind == ExtendedMetaData.ELEMENT_WILDCARD_FEATURE || featureKind == ExtendedMetaData.GROUP_FEATURE) {
+ // for feature-maps, traverse the entry list, looking entries matching the given feature name
FeatureMap fm = (FeatureMap)eObject.eGet(feature, true);
List result = new ArrayList(fm.size());
for (Iterator ifm = fm.iterator(); ifm.hasNext();)
@@ -757,7 +757,10 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
}
}
- return result.toArray();
+ // only return if we actually match, if we don't, we want to continue looking at the next feature
+ if(result.size() > 0) {
+ return result.toArray();
+ }
}
else if(matchesFeature(nameTestExpandedName, feature, exMD))
{

Back to the top