//get the entry-filter function and check its types
if(!(args[1].itemAt(0) instanceof FunctionReference))
throw new XPathException("No entry-filter function provided.");
entryFilterFunction = (FunctionReference)args[1].itemAt(0);
FunctionSignature entryFilterFunctionSig = entryFilterFunction.getSignature();
if(entryFilterFunctionSig.getArgumentCount() < 3)
throw new XPathException("entry-filter function must take at least 3 arguments.");
filterParam = args[2];
//get the entry-data function and check its types
if(!(args[3].itemAt(0) instanceof FunctionReference))
throw new XPathException("No entry-data function provided.");
entryDataFunction = (FunctionReference)args[3].itemAt(0);
FunctionSignature entryDataFunctionSig = entryDataFunction.getSignature();
if(entryDataFunctionSig.getArgumentCount() < 3)
throw new XPathException("entry-data function must take at least 3 arguments");
storeParam = args[4];
BinaryValue compressedData = ((BinaryValue)args[0].itemAt(0));