if (global) { Map ctx1 = (Map) variables.getLast(); Map ctx2 = (Map) parameters.getLast(); return (ctx1.containsKey(name) || ctx2.containsKey(name)); }
  public boolean containsKey(QName name, int type)  {    Iterator i = null;    switch (type)      {      case VARIABLE:        i = variables.iterator();        break;      case PARAM:        i = parameters.iterator();        break;      case WITH_PARAM:        Map ctx = (Map) withParameters.getFirst();        return ctx.containsKey(name);      }    if (i != null)  {    while (i.hasNext())      {        Map ctx = (Map) i.next();        if (ctx.containsKey(name))          {            return true;          }      }      }    return false;  }