Disappointed In SimpleXML

May 24, 2007

So I’m a little disappointed in PHP5’s SimpleXML object. Don’t get me wrong, it works great for accessing XML, but it’s terrible for deep manipulation. The biggest problem is that you can’t append SimpleXMLElement objects to each other.

For instance, I was working on a little project tracker that would use all XML for storage. Here is the var_dump of my XML file.

Long, I know. The point is that even though the structure looks pretty normal, you can’t do this, in this case in a sort function:

You get the error message:

That, my friends, is a bummer. You can’t assign sub-elements into the tree. Bummer. Now I have to switch back to my normal MySQL.

Categories: Geek
Tags: , ,

Leave A Comment

Your email will not be published.