NamespaceSupport namespaces = mappings.getNamespaces();
AttributeDescriptor root = mappings.getTargetFeature();
List<NestedAttributeMapping> nestedMappings = mappings.getNestedMappings();
// break into single steps
StepList simplifiedSteps = XPath.steps(root, targetXPath, namespaces);
List<Expression> matchingMappings = mappings.findMappingsFor(simplifiedSteps, false);
if (!nestedMappings.isEmpty()) {
// means some attributes are mapped separately in feature chaining
for (NestedAttributeMapping nestedMapping : nestedMappings) {
if (simplifiedSteps.startsWith(nestedMapping.getTargetXPath())) {
matchingMappings.add(new NestedAttributeExpression(simplifiedSteps,
nestedMapping));
}
}
}