The XML Expat Parser
The Expat parser is an event-based parser.
An event-based parser reports the XML above as a series of three events:
- Start element: from
- Start CDATA section, value: Jani
- Close element: from
These are part of the PHP core. There is no installation needed to use these functions.
The XML File
Example for the XML file "note.xml".
Initializing the XML Expat Parser
We want to initialize the XML Expat Parser in PHP, define some handlers for different XML events, and then parse the XML file.