public Item evaluateItem(XPathContext c) throws XPathException {
NodeInfo target;
if (argument.length > 1) {
target = (NodeInfo)argument[1].evaluateItem(c);
} else {
Item current = c.getContextItem();
if (current==null) {
XPathException err = new XPathException("The context item is undefined");
err.setErrorCode("XPDY0002");
err.setXPathContext(c);
throw err;
}
if (!(current instanceof NodeInfo)) {
XPathException err = new XPathException("The context item is not a node");
err.setErrorCode("XPTY0004");
err.setXPathContext(c);
throw err;
}
target = (NodeInfo)current;
}
final Item arg0Val = argument[0].evaluateItem(c);
final String testLang = (arg0Val==null ? "" : arg0Val.getStringValue());
boolean b = isLang(testLang, target);
return BooleanValue.get(b);
}