void setContext(Object node) {
    nsFromContext.clear();

    List<Namespace> nsl = null;
    if (node instanceof Element) {
      nsl = ((Element)node).getNamespacesInScope();
    }
    else if (node instanceof NamespaceContainer) {
      nsl = ((NamespaceContainer)node).getParentElement().getNamespacesInScope();
    }
    if (nsl != null) {
      for (Namespace ns : nsl) {
        nsFromContext.put(ns.getPrefix(), ns.getURI());
      }
    }
  }
void setContext(Object node)