# Difference between LiveDocument and Document

ACTF Editors provides access to model of content through IModelService interface. Implementations will return the content model as W3C DOM (org.w3c.dom). Typical IModelService implementations returns two types of Document (org.w3c.dom.Document), Live Document and Source Document.

## Live Document

    IModelService.getLiveDocument();

will return Live Document by accessing current object model of the Editor.

## Source Document

    IModelService.getDocument();

will return Document by parsing original source of content. In some cases, such as Web content with script, content will be changed in runtime, but this method always returns original DOM.

# In the case of ACTF Web Browser(IE)

## Live Document

getLiveDocument() method enables to access Live-DOM of Internet Explorer through ACTF DOMByCOM (org.eclipse.actf.model.dom.dombycom).

- org.w3c.dom.Node/Element are implemented
- org.w3c.dom.html.* interfaces are partially implemented
- can't clone node yet (planned to implement in future release)
- can access to currentStyle information of the Live-DOM Element (through IElementEx interface)

      if(element instanceof IElementEx) {
        IStyle style = ((IElementEx)element).getStyle();
        backgroundColor = (String) style.get("backgroundColor");
        ....
      }

- two types of attribute value
  - getAttribute(): returns only 'specified' attribute value
  - getCurrentAttribute(): returns 'actual' attribute value (automatically assigned value by IE)
- includes Flash Object Model as IFlashNode in DOM tree

## Source Document

getDocument() method parses original HTML source by using ACTF HTML Parser and returns the resulting DOM.

- org.w3c.dom.html.* interfaces are implemented
- can clone nodes

# Related topics

- ACTF Model Service