XML DOM

Warning! This page is not complete! The reader should refer to the DOM documentation at the World Wide Web Consortium web site.

The Document Object Model (DOM) is a programming model that represents parts of an XML document as objects. Each object is thereby accessible by referring to the object and subobjects with periods between them. Each object supports specific attributes and methods which allows dynamic content using XML. The DOM is cross platform compatible. It allows scripts and programs to access and update the content and style of elements in a document. The DOM presents documents as a hierarchy of nodes.

Node Types

  • Leaf - Can not have anything below them.
  • Normal - Nodes may have children nodes.
Node TypesMay Contain
DocumentDocument type, Element, Processing Instruction, Comment
Document FragmentEntity reference, Element, Processing Instruction, Comment, Text, CDATA Section
Document Type-
Entity ReferenceEntity reference, Element, Processing Instruction, Comment, Text, CDATA Section
ElementEntity reference, Element, Processing Instruction, Comment, Text, CDATA Section
AttrEntity reference, Textn
Processing Instructioon-
Comment-
Text-
CDATA Section-
EntityEntity reference, Element, Processing Instruction, Comment, Text, CDATA Section
Notation-

Node List - To handle lists of nodes. Named Node Max - For unorded sets of nodes. APIs in DOM are generally interfaces, not classes.

Type Definitions

DOMString - UTF-16 sequence of character units. also bound to the "String" type.

DOM Exceptions

DOM exceptions are defined by "exception DOMException". They are:

  • DOMSTRING_SIZE_ERR
  • HIERARCHY_REQUEST_ERR
  • INDEX_SIZE_ERR
  • INUSE_ATTRIBUTE_ERR
  • INVALID_CHARACTER_ERR
  • NOT_FOUND_ERR
  • NOT_SUPPORTED_ERR
  • NO_DATA_ALLOWED_ERR
  • NO_MODIFICATION_ALLOWED_ERR
  • WRONG_DOCUMENT_ERR


DOMImplementation Interface

Methods:

  • hasFeature

DocumentFragment Interface

Document Interface

DOM Objects and Subobjects

  • Core object
    • Array
    • Boolean
    • Date
    • Function
    • Math
    • Number
    • Object
    • String
    • RegExp
  • Document
    • Link
    • Area
    • Anchor
    • Image
    • Applet
    • Layer
  • Window
    • frame
    • Location
    • History
    • Screen
  • Form
    • Hidden
    • Text
    • Textarea
    • Password
    • FuleUpload
    • Button
    • Submit
    • Reset
    • Radio
    • Checkbox
    • Select
    • Option