Document

This is a scriptable interface corresponding to the nsIDOMDocument XPCOM interface.

Constants

The nsIDOMNode interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree.

For more information on this interface please see http://www.w3.org/TR/DOM-Level-2-Core/

short ELEMENT_NODE = 1
short ATTRIBUTE_NODE = 2
short TEXT_NODE = 3
short CDATA_SECTION_NODE = 4
short ENTITY_REFERENCE_NODE = 5
short ENTITY_NODE = 6
short PROCESSING_INSTRUCTION_NODE = 7
short COMMENT_NODE = 8
short DOCUMENT_NODE = 9
short DOCUMENT_TYPE_NODE = 10
short DOCUMENT_FRAGMENT_NODE = 11
short NOTATION_NODE = 12

Properties

readonly NamedNodeMap attributes

readonly NodeList childNodes

readonly DocumentType doctype

The nsIDOMDocument interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data. Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the nsIDOMDocument interface also contains the factory methods needed to create these objects.

For more information on this interface please see http://www.w3.org/TR/DOM-Level-2-Core/

readonly Element documentElement

readonly Node firstChild

readonly DOMImplementation implementation

readonly Node lastChild

readonly String localName

readonly String namespaceURI

readonly Node nextSibling

readonly String nodeName

readonly short nodeType

String nodeValue

readonly Document ownerDocument

readonly Node parentNode

String prefix

readonly Node previousSibling


Methods

Node appendChild ( Node newChild ) Node cloneNode ( boolean deep ) Attr createAttribute ( String name ) Attr createAttributeNS ( String namespaceURI , String qualifiedName ) CDATASection createCDATASection ( String data ) Comment createComment ( String data ) DocumentFragment createDocumentFragment ( ) Element createElement ( String tagName ) Element createElementNS ( String namespaceURI , String qualifiedName ) EntityReference createEntityReference ( String name ) ProcessingInstruction createProcessingInstruction ( String target , String data ) Text createTextNode ( String data ) Element getElementById ( String elementId ) NodeList getElementsByTagName ( String tagname ) NodeList getElementsByTagNameNS ( String namespaceURI , String localName ) boolean hasAttributes ( ) boolean hasChildNodes ( ) Node importNode ( Node importedNode , boolean deep ) Node insertBefore ( Node newChild , Node refChild ) boolean isSupported ( String feature , String version ) void normalize ( ) Node removeChild ( Node oldChild ) Node replaceChild ( Node newChild , Node oldChild )

Node appendChild ( Node newChild )

Arguments:
newChild

Node cloneNode ( boolean deep )

Arguments:
deep

Attr createAttribute ( String name )

Arguments:
name

Attr createAttributeNS ( String namespaceURI , String qualifiedName )

Arguments:
namespaceURI
qualifiedName

CDATASection createCDATASection ( String data )

Arguments:
data

Comment createComment ( String data )

Arguments:
data

DocumentFragment createDocumentFragment ( )


Element createElement ( String tagName )

Arguments:
tagName

Element createElementNS ( String namespaceURI , String qualifiedName )

Arguments:
namespaceURI
qualifiedName

EntityReference createEntityReference ( String name )

Arguments:
name

ProcessingInstruction createProcessingInstruction ( String target , String data )

Arguments:
target
data

Text createTextNode ( String data )

Arguments:
data

Element getElementById ( String elementId )

Arguments:
elementId

NodeList getElementsByTagName ( String tagname )

Arguments:
tagname

NodeList getElementsByTagNameNS ( String namespaceURI , String localName )

Arguments:
namespaceURI
localName

boolean hasAttributes ( )


boolean hasChildNodes ( )


Node importNode ( Node importedNode , boolean deep )

Arguments:
importedNode
deep

Node insertBefore ( Node newChild , Node refChild )

Arguments:
newChild
refChild

boolean isSupported ( String feature , String version )

Arguments:
feature
version

void normalize ( )


Node removeChild ( Node oldChild )

Arguments:
oldChild

Node replaceChild ( Node newChild , Node oldChild )

Arguments:
newChild
oldChild

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com