Re: [PHP-XML-DEV] XMLReader vs. SAX

[email protected] (Christian Stocker) Thu, 30 Sep 2004 14:02:34 +0200
Newsgroups php.xml.dev
Message-ID <[email protected]>

On 30.9.2004 13:27 Uhr, Vivian Steller wrote:
> i have some general question about XML Processing in PHP5 with "event based"
> parsers like SAX and XMLReader:
> 
> - first, is XMLReader more "lightweight" than SAX meaning less powerfull? in
> fact it is simpler.
> 
> - is XMLReader faster than SAX, especially if you want to create a DOM
> structure with SAX-callbackfuncs or with XMLReader->expand()?
> 
> - isn't it possible to programm an "xmlreader" with SAX? would this be
> better/faster than XMLReader extension? SAX: can you stop the processing
> procedure while xml parsing?

XMLReader is much faster than SAX, usually. And more powerfull and 
supports more of the XML basics (like proper namespaces support and even 
RelaxNG validation)

More here:

http://blog.bitflux.ch/archive/processing_large_xml_documents_with_php.html

chregu
-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [email protected]  |  gnupg-keyid 0x5CE1DECB