PHP XML Parser Introduction

The XML functions lets you parse, but not validate, XML documents.


XML is a data format for standardized structured document exchange. More information on XML can be found in our XML Tutorial.

This extension uses the Expat XML parser.

Expat is an event-based parser, it views an XML document as a series of events. When an event occurs, it calls a specified function to handle it.



Expat is a non-validating parser, and ignores any DTDs linked to a document. However, if the document is not well formed it will end with an error message.


Because it is an event-based, non validating parser, Expat is fast and well suited for web applications.


The XML parser functions lets you create XML parsers and define handlers for XML events.