Name
handle: operation, key, data, src, dst(3)
Synopsis
This method is called whenever the Node
object to which the parent UserDataHandler
-derived object is
attached is imported or cloned. This method is to be implemented
by users of the DOM who wish to receive notifications when watched
Node
objects are
manipulated.
Tip
When implementing the handle(
)
method, it is important to catch any exceptions that
might be thrown so that they will not be raised within the
calling DOM code. The behavior within the DOM is undefined if an
exception is raised within this method.
Arguments
- operation: unsigned short
The type of operation that occurred, based on the following values:
Constant name | Value | Meaning |
NODE_CLONED | 1 | The watched node was cloned using |
NODE_IMPORTED | 2 | The watched node was imported using |
NODE_DELETED | 3 | The node was deleted, which is not necessarily reliable in environments that have no explicit delete operator (such as Java). |
NODE_RENAMED | 4 | The node was renamed using |
NODE_ADOPTED | 5 | The watched node was adopted using |
- key: DOMString
The user-defined key from the
Node.setUserData( )
method for which thehandle( )
method is being called.- data: DOMUserData
The user data corresponding to the
key
argument that was originally set using theNode.setUserData( )
method.- src: Node
The node being cloned, adopted, imported, or renamed. This argument will be
null
if the node is being deleted.- dst: Node
The newly cloned or imported node, ...
Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.