In this post on Christian Stocker's blog today, he gives a quick example of how to extend SimpleXML with some "missing functionality" that he's needed.
From Rob Richards on the PHP internals mailinglist: "This [getting name and type of a Node] can be done extending the SimpleXMLElement and the functions are a whole 1 line of user code".
Ever thought SimpleXML is too simple? Did you know, you can easily extend the SimpleXMLElement class?
Basically, it abuses the DOM XML's import ability to pull in a SimpleXML object and use the nodeName and nodeType on it to get the corresponding data. Simple? check. Useful? check. Something to add to the library? definitely...




