NAME
Mozilla::DOM::Node
DESCRIPTION
Mozilla::DOM::Node is a wrapper around an instance of Mozilla's nsIDOMNode interface. This class inherits from Supports.
* 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
* L<http:E<sol>E<sol>www.w3.orgE<sol>TRE<sol>DOM-Level-2-CoreE<sol>>
The following constants are available to be compared with "GetNodeType". XXX: This is currently buggy, because you have to call them as methods on the node object. DEPRECATED: a little premature to deprecate, not having an alternative (aside from using the numbers directly), but I really don't like how they're currently implemented.
- ELEMENT_NODE
- ATTRIBUTE_NODE
- TEXT_NODE
- CDATA_SECTION_NODE
- ENTITY_REFERENCE_NODE
- ENTITY_NODE
- PROCESSING_INSTRUCTION_NODE
- COMMENT_NODE
- DOCUMENT_NODE
- DOCUMENT_TYPE_NODE
- DOCUMENT_FRAGMENT_NODE
- NOTATION_NODE
CLASS METHODS
$iid = Mozilla::DOM::Node->GetIID()
Pass this to QueryInterface.
METHODS
$node = $node->GetLastChild()
$node = $node->AppendChild($newChildNode)
$newChild (Mozilla::DOM::Node)
$node = $node->CloneNode($deep)
$deep (boolean)
$deep is a boolean
DOM 2 spec: When a Node is copied using the cloneNode method the EventListeners attached to the source Node are not attached to the copied Node. If the user wishes the same EventListeners to be added to the newly created copy the user must add them manually.
$namednodemap = $node->GetAttributes()
XXX: I'm thinking that methods like this should also return a list in list context. It's kinda gimpy having to call GetLength and loop over index numbers calling Item. Also, why does everything return NamedNodeMap or NodeList? I'd rather get a list of Attr.
$nodelist = $node->GetChildNodes()
$node = $node->GetFirstChild()
node = $node->GetLastChild
$name = $node->GetLocalName()
$uri = $node->GetNamespaceURI()
$node = $node->GetNextSibling()
$name = $node->GetNodeName()
$type = $node->GetNodeType()
$type is a number
$value = $node->GetNodeValue()
$value is a string
$document = $node->GetOwnerDocument()
$node = $node->GetParentNode()
$prefix = $node->GetPrefix()
$node = $node->GetPreviousSibling()
$bool = $node->HasAttributes()
$bool = $node->HasChildNodes()
$node = $node->InsertBefore($newChildNode, $refChildNode)
$newChild (Mozilla::DOM::Node)
$refChild (Mozilla::DOM::Node)
$bool = $node->IsSupported($feature, $version)
$feature (string)
$version (string)
two string args
$node->Normalize()
$node = $node->RemoveChild($oldChildNode)
$oldChild (Mozilla::DOM::Node)
$node = $node->ReplaceChild($newChildNode, $oldChildNode)
$newChild (Mozilla::DOM::Node)
$oldChild (Mozilla::DOM::Node)
$node->SetNodeValue($value)
$value (string)
$node->SetPrefix($prefix)
$aPrefix (string)
SEE ALSO
COPYRIGHT
Copyright (C) 2005, Scott Lanning
This software is licensed under the LGPL. See Mozilla::DOM for a full notice.