Number number = processor.evaluateAsNumber(document1, expr);
assertEquals(2, number.intValue());
// 5. Test with a custom prefix resolver using a different document in a different namespace,
// to be sure the custom prefix resolver is used
number = processor.evaluateAsNumber(document2, expr, new PrefixResolver() {
public String prefixToNamespace(String prefix)
{
if (prefix.equals("test"))
return "http://localhost/test2";
return null;