if(symbolName.equalsIgnoreCase("xml") || symbolName.equalsIgnoreCase(group.getName() + ".xml")) { //$NON-NLS-1$ //$NON-NLS-2$
if(elements.size() != 1) {
throw new QueryResolverException(QueryPlugin.Util.getString("XMLQueryResolver.xml_only_valid_alone")); //$NON-NLS-1$
}
select.clearSymbols();
AllSymbol all = new AllSymbol();
all.setElementSymbols(validElements);
select.addSymbol(all);
query.setSelect(select);
return;
}
// normal elements
resolveElement((ElementSymbol)ss, validElements, externalGroups, metadata);
} else if (ss instanceof AllInGroupSymbol) {
// Resolve the element with "*" case. such as "A.*"
// by stripping off the ".*" part,
String symbolName = ss.getName();
int index = symbolName.indexOf("*"); //$NON-NLS-1$
String elementPart = symbolName.substring(0, index-1);
// Check for case where we have model.doc.*
if(elementPart.equalsIgnoreCase(group.getName())) {
select.clearSymbols();
AllSymbol all = new AllSymbol();
all.setElementSymbols(validElements);
select.addSymbol(all);
query.setSelect(select);
} else {
// resovlve the node which is specified
ElementSymbol elementSymbol = new ElementSymbol(elementPart);
resolveElement(elementSymbol, validElements, externalGroups, metadata);
// now find all the elements under this node and set as elements.
List<ElementSymbol> elementsInNode = getElementsUnderNode(elementSymbol, validElements, metadata);
((AllInGroupSymbol)ss).setElementSymbols(elementsInNode);
}
} else if (ss instanceof AllSymbol) {
AllSymbol all = (AllSymbol)ss;
all.setElementSymbols(validElements);
return;
} else if (ss instanceof ExpressionSymbol) {
throw new QueryResolverException(QueryPlugin.Util.getString("XMLQueryResolver.no_expressions_in_select")); //$NON-NLS-1$
} else if (ss instanceof AliasSymbol) {
throw new QueryResolverException("ERR.015.008.0070", QueryPlugin.Util.getString("ERR.015.008.0070")); //$NON-NLS-1$ //$NON-NLS-2$