The Node Interface

The primary purpose of the Node interface is to define the base functionality for all node types. It defines the set of attributes, methods, and constants that must be available on any node within the DOM hierarchy. This makes it possible to traverse a DOM hierarchy in a uniform fashion strictly using the Node interface without having to downcast to more specific interface types. The more specific interfaces are available when necessary to access features that only make sense for a given node type.

One of the tradeoffs of a fairly general base interface like Node is that some of its operations do not apply to all of the node types. The DOM working group made a conscious decision to not factor the Node interface to the smallest ...

Get Essential XML: Beyond Markup 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.