June 2002
Intermediate to advanced
384 pages
7h 53m
English
The DOM classes discussed in the previous section are more than adequate for most common tasks, but getting used to them can take awhile.
Additionally, for long and complex documents containing a large number of elements and/or levels, progressing from node to node in an iterative manner can often be tedious.You can use a recursive function to simplify the process, but you’ll still have to write a fair amount of code to create and manipulate node collections, which are at different levels of the tree.
It’s precisely to simplify this process that PHP also comes with a couple of XPath classes. XPath, as you may already know, is an addressing mechanism for XML documents, designed to allow XML document ...