Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Parsing XML with PHP - not DOM XML
December 13, 2005, 10:03 am
rate this thread
XML. Unfortunetely, I have run into a few problems with size and was
told that for the type of parsing I am doing I would be better using
event driven parsing like SAX.
Below I have a simple example of XML similar (although much much
smaller) to the one I am using for real.
All I want to do is to output them as:
How would I do this uisng something like SAX / EXPAT? I found tutorials
but didnt really understand them enough to know if I was looking up the
correct thing. Any help would be much appreciated.
Re: Parsing XML with PHP - not DOM XML
The manual has a very straight forward examples. http://ie2.php.net/xml
But if you want a wrapper: I like the xml classes found here
http://phpxmlclasses.sourceforge.net /. For something simple like this
check out class_path_parser. There is an example there as well. It's
kinda old now so some of the functions may have depreciated.
But I suppose the pear xml package
(http://pear.php.net/manual/en/package.xml.xml-parser.php ) would be
more up to date.