Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dynamically Typed:
XMLReader with PHP5 / PECL
Apr 26, 2004 @ 12:35:26

In the latest post from Dynamically Typed, Harry Fuecks talks about a new XML technology that seems to be coming right along with PHP5 - XML_Pull.

Essentially it means an (arguably) easier way of parsing XML than with SAX. Philip's article Back to Basics: XML In .NET shows .NET's XMLReader in action here and it PHP it would be much the same.

He goes over a code sample to give you a more detailed look at what the code might look like. So, in other words, rather than SAX call backs, you can handle the entire document in a single loop - great for hacking! He moves on, giving some links to the different ways to parse XML, including Push via the SAX extension, Pull via this new extension, Tree thanks to DOM, Object Mapping through Simple XML, and Cursor (no support yet in PHP?). And, thankfull, accoring to the benchmarks, libxml2, the library these are all built on, is more or less the fastest XML parser out there.

tagged:

Link:


Trending Topics: