4.1 Introduction
We discussed parsing in Chapter 2 and document generation in Chapter 3. These chapters covered many important aspects of processing XML documents. However, in the development of Web applications, parsing and generation are not sufficient. You also need to understand how to manipulate the internal representation of XML documents. If you use SAX, you need to design the internal structure yourself. If you use DOM, you need to understand techniques for dealing with DOM trees using the DOM API.
In this chapter, we discuss basic techniques for and some pitfalls of manipulating DOM structures. Because of space limitations, we cannot describe every detail of DOM. Please consult the latest DOM specification whenever you have further questions. The DOM specification consists of six parts: "Core," "HTML," "Views," "Events," "Style," and "Traversal and Range." We discuss the parts "Core" and "Traversal and Range." Other parts are used when a document has a user interface like Web browsers.
|