Over the past year I have been trying to find the perfect XML class that will parse ANY XML document and allow ease of use. I have tried numerous types of xml, and for each type there seems to be a different way to parse it that makes sense. Depending on if the XML contains a DTD file or if it contains attributes, or other types of unique elements, I am forced to use different methods of parsing, such as SAX, DOM, XSLT, etc... Then, depending on how I parse the xml depends on how i have to display the output. One way I have to deal with huge arrays or xpaths, and another way I have to call certain objects. Becasue of this I cannot standardize my output classes either, and it's just more work than it's worth in a lot of cases.
Is there a BEST way to dynamically parse ALL XML in php? IMO, parsing XML in PHP is probably the least documented and most pain in the ass thing I have ever tried to do. It really is something that is not discussed enough and all the tutorials and examples cover the most basic XML feeds possible. Nobody wants to touch the really messy stuff, things that are most prevelant in the real world. While I should be able to create ONE xml class and parse any xml document no problem, I find myself having to re-create the wheel every time a new feed is available. Does anyone have any insight on this? I feel like I'm either missing the big picture here or something.