Java and DOM sucks

August 18th, 2005

Java and DOM sucks. There is no decent open source DOM toolkit to be had.

Criteria:

  • Efficient
  • Has an intuitive and friendly API
  • Uses javax.xml.namespace.QName instead of its own version or no QNames
  • Has a commercial friendly license (LGPL doesn’t count because too many people are scared of it and conflicting interpretations)

DOM4J: Has #1, #4 and a little of #2

JDOM: Has #2, #4, not sure about #1

XOM: Has #1, #2

W3C DOM: Has #3 and #4, not sure about #1

Update: DOM4J performance isn’t too bad as a commenter pointed out. XOM is still faster I believe though.

6 Responses to “Java and DOM sucks”

  1. a Says:

    If you don’t like them, write your own.

  2. a Says:

    Do you have any evidence that DOM4J is not efficient?

  3. Dan Diephouse Says:

    I have written my own - YOM, which is a XOM clone, but not too sure about the legal implications of that.

    Regarding DOM4J, there are some benchmarks out there that you can look. Just do a little googling.

  4. F.Baube Says:

    Writing a facade to implement #3 should take you about two minutes :) The XOM license is described in plain english, and not THAT scary.

  5. dandiep Says:

    First, it is NOT ME who is scared. It is other people (like Apache people).

    Second, writing a Facade has legal implications as well. It could quite probably fall under a derivitive work under the LGPL license.

  6. anonymous Says:

    The benchmark that I looked at doesn’t support your claim.