cplus version of DOM: add context