public GlobalVariable compile(Executable exec, int slot) throws XPathException {
TypeHierarchy th = exec.getConfiguration().getTypeHierarchy();
GlobalVariable var;
if (isParameter) {
var = new GlobalParam();
var.setExecutable(exec);
var.setRequiredParam(value==null);
} else {
var = new GlobalVariable();
var.setExecutable(exec);