return result;
}
protected Item getKey(Sequence contextSequence, Item contextItem) throws XPathException {
Sequence keySeq = getArgument(1).eval(contextSequence, contextItem);
Item key = keySeq.itemAt(0);
if (!(Type.subTypeOf(key.getType(), Type.STRING) || Type.subTypeOf(key.getType(), Type.NODE)))
throw new XPathException(this, "Second argument to ft:query should either be a query string or " +
"an XML element describing the query. Found: " + Type.getTypeName(key.getType()));
return key;
}