public static void pushNodeNamespace(Node node,Stack<PrefixMapping> namespaces){
  String uri=node.getNamespace();
  for (int i=0, size=namespaces.size(); i < size; i++) {
    PrefixMapping pm=namespaces.get(i);
    if (pm.equals(uri)) {
      namespaces.push(pm);
      return;
    }
  }
  namespaces.push(new PrefixMapping(uri));
}

public static void pushNodeNamespace ( Node node , Stack < PrefixMapping > namespaces ) { String uri = node . getNamespace ( ) ; for ( int i = 0 , size = namespaces . size ( ) ; i < size ; i ++ ) { PrefixMapping pm = namespaces . get ( i ) ; if ( pm . equals ( uri ) ) { namespaces . push ( pm ) ; return ; } } namespaces . push ( new PrefixMapping ( uri ) ) ; }
push the prefixmapping for the node onto the namespaces stack .
