lib/dom.js
function(el, deep) {
    var sub = document.createElement(el.nodeName)
      , attr = el.attributes
      , i = attr.length;

    while (i--) {
      if (attr[i].nodeValue) {
        sub.setAttribute(attr[i].name, attr[i].value);
      }
    }

    if (el.namespaceURI) {
      sub.namespaceURI = el.namespaceURI;
    }

    if (el.baseURI) {
      sub.baseURI = el.baseURI;
    }

    if (deep) {
      DOM.setContent(sub, DOM.getContent(el));
    }

    return clone; 
  }
function(el, deep) {
    var sub = document.createElement(el.nodeName)
      , attr = el.attributes
      , i = attr.length;

    while (i--) {
      if (attr[i].nodeValue) {
        sub.setAttribute(attr[i].name, attr[i].value);
      }
    }

    if (el.namespaceURI) {
      sub.namespaceURI = el.namespaceURI;
    }

    if (el.baseURI) {
      sub.baseURI = el.baseURI;
    }

    if (deep) {
      DOM.setContent(sub, DOM.getContent(el));
    }

    return clone; 
  }
function ( el , deep ) { var sub = document . createElement ( el . nodeName ) , attr = el . attributes , i = attr . length ; while ( i -- ) { if ( attr [ i ] . nodeValue ) { sub . setAttribute ( attr [ i ] . name , attr [ i ] . value ) ; } } if ( el . namespaceURI ) { sub . namespaceURI = el . namespaceURI ; } if ( el . baseURI ) { sub . baseURI = el . baseURI ; } if ( deep ) { DOM . setContent ( sub , DOM . getContent ( el ) ) ; } return clone ; }
this gives a clean "userspace" clone with no events or data. .cloneNode is so damn buggy i dont even want to touch it.
this gives a clean userspace clone with no events or data . . cloneNode is so damn buggy i dont even want to touch it .