* it returns a StringValue in the case of unparsed-text(), or a BooleanValue
* in the case of unparsed-text-available()
*/
public Item evaluateItem(XPathContext context) throws XPathException {
StringValue result;
try {
StringValue hrefVal = (StringValue)argument[0].evaluateItem(context);
if (hrefVal == null) {
return null;
}
String href = hrefVal.getStringValue();
String encoding = null;
if (getNumberOfArguments() == 2) {
encoding = argument[1].evaluateItem(context).getStringValue();
}
result = new StringValue(
readFile(href, expressionBaseURI, encoding, context));
} catch (XPathException err) {
if (operation == UNPARSED_TEXT_AVAILABLE) {
return BooleanValue.FALSE;
} else {