Find the answer to your question
XML parser support is much better in PHP 5 relative to PHP 4. PHP 5’s Simple XML extension is a very good basic XML parser.
XML parser support in PHP 4 was limited. The default installation included a SAX parser. A DOM parser could be enabled (uncomment extension=extensions\php_domxml.dll in php.ini in Windows) but the DOM parser was unstable.
PHP 5 supports several XML parsers including the following :
- modeled after Perl’s XML:Simple
- easy object-oriented XML parsing, with some limitations relative to other parsers
- random access to any element in XML object
- SAX2 event-based parsing
- backwards compatible with PHP 4 parser
- object-oriented navigation, creation and modification of XML documents
- stream-oriented XML parsing
- based upon Microsoft’s System.Xml.XmlReader
- no random access to XML tree – forward-only parsing
PHP 4 or 5
The following parsers are written in PHP, so are therefore slower than most of the compiled XML parsers mentioned above. They generally are compatible with PHP 4 or 5.
PEAR:XML_Parser – a SAX-based parser.
PEAR:XML_Tree – a DOM-based parser that arose because a DOM-based parser was not in default PHP 4 installations.