DOM(Document Object Model) este un standard W3C si reprezinta un api pentru documente HMTL si XML. DOM defineste structura logica a documentelor si modul in care documentele sunt accesate si manipulate. Numele de Document Object Model provine din faptul ca documentele sunt modelate folosind obiecte.
Cu DOM programatorii pot construi documente, pot naviga prin structura documentului, pot adauga, modifica, sterge elemente si continut. DOM specifica interfetele si obiectele folosite pentru a reprezenta si manipula un obiect, functionalitatea si atributele acestor obiecte si relatiile dintre obiecte. Documentele sunt reprezentate ca o ierarhie de obiecte de tip care pot avea sau nu descendenti sau nu, dupa cum urmeaza:
* Document -- Element (maximum of one), ProcessingInstruction, Comment, DocumentType (maximum of one)
* DocumentFragment -- Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
* DocumentType -- no children
* EntityReference -- Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
* Element -- Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference
* Attr -- Text, EntityReference
* ProcessingInstruction -- no children
* Comment -- no children
* Text -- no children
* CDATASection -- no children
* Entity -- Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
* Notation -- no children

Un exemplu de ierarhie arborescenta, corespunzand unui HTML simplu, in imaginea de mai jos

Specificatiile pentru aceste interfete sunt scrise in IDL(Interface Definition Language) pentru a fi independente de limbajul de implementare. De exemplu:
interface DocumentType : Node {
readonly attribute DOMString name;
readonly attribute NamedNodeMap entities;
readonly attribute NamedNodeMap notations;
// Introduced in DOM Level 2:
readonly attribute DOMString publicId;
// Introduced in DOM Level 2:
readonly attribute DOMString systemId;
// Introduced in DOM Level 2:
readonly attribute DOMString internalSubset;
};

Aceste specificatii sunt implementate de api-uri pentru diverse limbaje de programare cum ar fi:
- java - http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-summary.html
- python - http://www.python.org/doc/2.4/lib/module-xml.dom.html
- php - http://php.net/dom
- C - http://xerces.apache.org/xerces-c/program-dom.html