} else if (selectorSteps[index.i].isStarStar()) {
if(index.i == 0) {
// No more tokens to match and ** matches everything
return true;
} else if(index.i == 1) {
SelectorStep parentStep = selectorSteps[index.i - 1];
if(parentElement == null && parentStep.isRooted()) {
// we're at the root of the document and the only selector left is
// the document selector. Pass..
return true;
} else
if(parentElement == null) {
// we're at the root of the document, yet there are still
// unmatched tokens in the selector. Fail...
return false;
}
} else if(parentElement == null) {
// we're at the root of the document, yet there are still
// unmatched tokens in the selector. Fail...
return false;
}
SelectorStep parentStep = selectorSteps[index.i - 1];
if(parentStep.isTargetedAtElement(parentElement)) {
if(!parentStep.isStarStar()) {
XPathExpressionEvaluator evaluator = parentStep.getPredicatesEvaluator();
if(evaluator == null) {
logger.debug("Predicate Evaluators for resource [" + this + "] is null. XPath step predicates will not be evaluated.");
} else if(!evaluator.evaluate(parentElement, index.executionContext)) {
return false;
}