SimpleXML, in keeping with its theme of simplicity, has all its methods contained in a single class. Not so with DOM. DOM is a class hierarchy that represents XML documents, nodes, elements, and attributes with separate classes, as you can see in Figure 5.1. Many of the classes inherit from
DOMNode, so you’ll see several references to that class throughout the chapter. For now, let’s start at the beginning: how does an XML document become a
Like SimpleXML, DOM is nearly completely object oriented. Unlike SimpleXML, however, there are no stand-alone functions ...