What Are the Major Approaches to XML Parsing?

Currently, there are two major methodologies behind XML parsing. First is a group of parsers built to conform to the Document Object Model (DOM) standard. Second is another group of parsers built to conform to the Simple API for XML (SAX) standard.

The DOM-based parsers generate a tree of objects in memory based on the structure and contents of the XML data. This enables you to walk through the tree and access information or access only a portion (or branch) of your XML data.

SAX-based parsers take a different approach to parsing—they are event-driven. An event-driven XML parser module searches through XML data and looks for particular patterns (for example, the start of an element, the end of ...

Get XML and Perl 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.