// TODO: optimize on the expression and cache for reuse
final XPathMatchingAlgorithm xpathAlg = new XPathMatchingAlgorithm(
expr);
AxiomaticSet set = null;
try
{
set = xpathAlg.evaluate(node);
// map dom nodes to tag identifiers
set = elem2TagIdMapper.map(set);
}
catch (final InvalidExpressionException e)
{
JSFCorePlugin.log(e, "Problem with expression: " + expr //$NON-NLS-1$
+ " on node " + node); //$NON-NLS-1$
return;
}
catch (final EvaluationException e)
{
JSFCorePlugin.log(e, "Problem evaluating expression: " //$NON-NLS-1$
+ expr + " on node " + node); //$NON-NLS-1$
return;
}
final TagSet constraintData = tagConstraint.getSatisfiesSet();
final AxiomaticSet constraintSet = new ConcreteAxiomaticSet();
for (final Iterator it = constraintData.getTags().iterator(); it
.hasNext();)
{
final TagId tagId = (TagId) it.next();
constraintSet.add(TagIdentifierFactory.createJSPTagWrapper(
tagId.getUri(), tagId.getName()));
}
final MemberConstraint memberConstraint = new MemberConstraint(
constraintSet);
final Diagnostic diag = memberConstraint.isSatisfied(set);