Chapter 3. PHP and the Document Object Model (DOM)

“A fool sees not the same tree that a wise man sees.”

—William Blake

If you’ve been paying attention, you now know the basics of parsing XML with PHP. As Chapter 2, “PHP and the Simple API for XML (SAX)” demonstrated, it’s pretty simple—whip up some XML data and mix in a few callback functions. It’s a simple yet effective recipe, and one that can be used to great effect for the rapid development of XML-based applications.

That said, although the event-driven approach to XML parsing is certainly popular, it’s not the only option available. PHP also allows you to parse XML using the Document Object ...

Get XML and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.