Forum Moderators: open
I'm really curious why people choose the route they have for processing XML with PHP. I am aware of the processor load and processing times that are associated with each method, but would appreciate any light shed on this subject that elaborates or goes further than that.
What kind of projects do you use either for? I am working on a shell for a blogging, forum, or site news type application that uses xml instead of a database. previously, i have designed a blog that uses flat text files.
take care
jonathan
an event based parser like expat is appropriate when you just need data gleaned from certain specific tags which happen to be a relatively small subset of the total number of tags present in an xml doc. in such cases it makes lesser sense to create a tree out of the whole doc when you only need data from a small number of tags.....
also, event based parsers have small memory footprints .. so they are typically well suited if your web app is a part of a high traffic website....
coding-wise, programmers love dom because the syntax is so elegant and the resultant xml tree makes it so easy to get to the child nodes or the parent nodes corresponding to any given node.
ultimately, it depends on your app.