O'Reilly logo

XML Companion, The, Third Edition by Neil Bradley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Iteration and tree-walking

The concept of tree-walking (discussed in Chapter 16) is a useful concept when working with a DOM structure. DOM Level 2 supports this concept in a standard way. A new optional package for convenient traversal of document trees has been introduced in this version of the standard. This package includes four interfaces: DocumentTraversal, TreeWalker, Iterator and NodeFilter.

Document traversal interface

There are two ways of traversing a document tree, one more sophisticated than the other. Objects that implement these two approaches can be created on behalf of the application using an object that implements the DocumentTraversal interface.

For example, the Xerces parser includes a class called DocumentImpl that implements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required