For years now, people who know me have had to endure my endless rants about the pain that one must go through to do XML processing in Java. It brings back memories of my younger years of watching the Simpsons. There was an episode where Lisa Simpson was performing a science experiment on Bart by hooking up charged electrodes to a cupcake and predicting when Bart will learn that the cupcake is hazardous. Needless to say, Bart was the victim of a very cruel joke.
In many ways, I classify the poor sucker… err… I mean Java developer who must process and deal with XML a victim of a very cruel joke. First, there was the whole SAX and JAXP fiasco of API declarations vs actual implementations. For a while, it seemed that each major project/utility would include its own XML parser implementations and they would all be on different versions. Talk about write once, class cast exception everywhere.
Admittedly, those Java tools have gotten much better over the years. But dealing with XML in Java still amounts to an over abundance of classes, endless getters and setters, and in some cases, code generation and maintenance overhead. In having worked with specifications such as Dublin Core and IMS, I know for a fact that I prefer having my dentist drill into my mouth with sharp instruments over XML processing in Java. At least, the pain caused by my dentist will eventually go away.
Oh, I can only dream…