The trouble with DOM

DOM, the Document Object Model, is a standard designed by the World Wide Web Consortium as a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. DOM defines a set of Application Programmers Interfaces (API's) that allow programmers to change the content of a document dynamically.

DOM does actually have some good points going for it.

However, the bad outweights the good.

Of course there a reasons and explanations enough and the W3C admits many of these mistakes. That does not make me happy with the result though.

There is a whole industry of competing API's ready to take over from DOM like Java's JDom, PHP's SimpleXML. This is logical as I am far from the first to voice most of these opinions. Then why is not everybody using them? Of course there is some inertia due to the fact the DOM is supported everywhere. More important though - in my opinion - is that all these alternatives solve only some of the problems mentioned above.

Having said all that I must applaud PHP's SimpleXML. In five years of research it has the distinction of being the only new method for using XML that made me think: Yes! This is a step in the right direction!

© MagnaFacta BV 2006-2009