|
The XML Document Object Model
An Introduction |
|
Prof. David Bernstein |
| Computer Science Department |
| bernstdh@jmu.edu |
A Simple (Hierarchical) Model
P)A Portion of the DOM 2.0 Core (in UML)
Node InterfaceElement
Attr
Text
Comment
Document
DocumentType
Node InterfaceinsertBefore(newChild:Node, refChild:Node):Node
replaceChild(newChild:Node, oldChild:Node):Node
removeChild(oldChild:Node):Node
appendChild(newChild:Node):Node
hasChildNodes():boolean
nodeType: int
parentNode: Node
childNodes: NodeList
firstChild: Node
lastChild: Node
previousSibling: Node
nextSibling: Node
attributes: NamedNodeMap
NodeList InterfaceNode
objects (indexed starting at 0)item(index:unsigned_long): Node
NamedNodeMap InterfaceNode objects that can be
accessed by nameNodeList and its
members are not orderedgetNamedItem(name:DOMString): Node
setNamedItem(arg:Node): Node
removeNamedItem(name:DOMString): Node
Attr InterfaceElement
Node (i.e., "is a" Node)Node that contains itname: DOMString
specified: boolean (as opposed to a default)value: DOMString
ownerElement: Element
Element InterfaceNode
tagName: DOMString
getAttribute(name:DOMString): DOMString
getAttributeNode(name:DOMString): Attr
setAttribute(name:DOMString, value:DOMString): void
setAttribute(attribute:Attr): void
removeAttribute(name:DOMString): void
removeAttribute(attribute:Attr): void
getElementsByTagName(name:DOMString): NodeList
hasAttribute(name:DOMString): boolean
Document InterfacecreateAttribute(name:DOMString): Attr
createComment(text:DOMString): Comment
createElement(tag:DOMString): Element
createTextNode(text:DOMString): Text
getElementByID(id:DOMString): Element
getElementsByTagName(tag:DOMString): NodeList
Text Interface:
Element or Attr
Comment Interface: