April 2026
Intermediate
1009 pages
34h 15m
English
Now it's time for the actual work. In the following sections, we will use various methods to access and edit XML documents.
The SAX parser (or XML parser) goes through the XML document and reacts to events. A SAX parser may seem a little complicated at first glance, but it is actually not. We will show you the most important steps using a simple example.
Our starting point is an extended version of Listing 29.1. You can find the file under the name products.xml in the online materials for the book (see Preface).
First create the SAX parser:
$xml_parser = xml_parser_create();
Now you need an event handler with two functions. They react when the SAX parser generates an event. There are two types of ...
Read now
Unlock full access