Replace doc and docEl.