June 2002
Intermediate to advanced
384 pages
7h 53m
English
PHP 4.0 comes with a very capable SAX parser based on the expat library. Created by James Clark, the expat library is a fast, robust SAX implementation that provides XML parsing capabilities to a number of open-source projects, including the Mozilla browser (http://www.mozilla.org/).
If you’re using a stock PHP binary, it’s quite likely that you’ll need to recompile PHP to add support for this library to your PHP build. Detailed instructions for accomplishing this are available in Appendix A, “Recompiling PHP to Add XML Support.”
You can do a number of complex things with a SAX parser; however, I’ll begin with something simple to illustrate just how it all fits together. Let’s go back to the previous XML document ...