*/
public class ErrorInfoFunction extends AbstractErrorFunction {
public Value invoke(ExpressionContext context, Value[] arguments) throws ExpressionException {
assertArgumentCount(arguments, 1);
StringValue arg = (StringValue) arguments[0];
SAXParseException x = getException(context);
ExpressionFactory factory = context.getFactory();
Value result = Sequence.EMPTY;
if (x instanceof XMLPipelineException) {
XMLPipelineException pipelineException = (XMLPipelineException) x;
Map errorProperties = pipelineException.getErrorProperties();
if (errorProperties != null) {
Object value = errorProperties.get(arg.asJavaString());
if (value != null) {
result = factory.createStringValue(value.toString());
}
}
}