LOG.debug( MSG.getMessage( Keys.EVAL_XPATH, xpathExpr,
evalContextNode.getNodeName() ) );
}
if ( xpathExpr.getNamespaceContext() == null || !( xpathExpr.getNamespaceContext() instanceof DomNamespaceContext ) )
{
throw new QueryEvaluationErrorException( MSG.getMessage( Keys.BAD_XPATH_NAMESPACE_CONTEXT ) );
}
DomNamespaceContext domNsContext = (DomNamespaceContext) xpathExpr.getNamespaceContext();
XObject xResult;
try
{
xResult = XPathAPI.eval( evalContextNode,
xpathExpr.getValue(),
domNsContext.getContextNode() );
}
catch ( Exception e )
{
throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED, xpathExpr.getValue(),
e.getLocalizedMessage() ) );
}
return normalizeResult( xResult );
}