if (global) { Map ctx = (Map) variables.getLast(); Object ret = ctx.get(name); if (ret == null) { ctx = (Map) parameters.getLast(); ret = ctx.get(name); } return ret; }
  public Object get(QName name, Node context, int pos, int len)  {    //System.err.println("bindings.get: "+name);    //System.err.println("\t"+toString());    Object ret = null;    //if (parameters.size() > 1 && containsKey(name, PARAM))      // check that template defines parameter      {        Map cwp = (Map) withParameters.getFirst();        ret = cwp.get(name);        //System.err.println("\twith-param: ret="+ret);      }    if (ret == null)      {    for (Iterator i = variables.iterator(); i.hasNext() && ret == null; )      {        Map vctx = (Map) i.next();        ret = vctx.get(name);      }        //System.err.println("\tvariable: ret="+ret);      }    if (ret == null)      {        for (Iterator i = parameters.iterator(); i.hasNext() && ret == null; )          {            Map pctx = (Map) i.next();            ret = pctx.get(name);          }        //System.err.println("\tparam: ret="+ret);      }    /*if (ret instanceof Expr && context != null)      {        Expr expr = (Expr) ret;        ret = expr.evaluate(context, 1, 1);      }*/    if (ret instanceof Node)      {        ret = Collections.singleton(ret);      }    if (ret == null)      {        ret = "";      }    //System.err.println("\tret="+ret);    return ret;  }