A quick code search on openhub and github:
* library | openhub | github
* org.w3c.dom | 180k [1] | 1.1m [2]
* jdom 1 | 35k [3] | 112k [4]
* stax | 25k [5] | 127k [6]
* jdom 2 | 2k [7] | | 20k [8]
It seems that jdom2 is not that popular, at least not in the projects
tracked by openhub or hosted on github.
[1]
On 10/06/15 21:47, Sergiu Dumitriu wrote:
+1 for removing DOM4J, it's been dead for 10
years.
But why do we need a non w3c library at all? Why is JDOM better than DOM?
The main reason is that it is supposedly easier to use for Java
programmers, but is it that much easier to justify having different
APIs? The standard DOM is part of the Java language.
Well... my experience in the
ActiveMath group with quite several
developers is that JDOM is way easier at representing properly the fine
details of XML in its completeness than DOM. Also, we ran experiment
with the Xerces DOM implementation around 2005 or so, and basically got
the following time factors
- Xerces DOM: 4
- Xerces SAX with JDOM: 2
- Saxon SAX with JDOM: 1
So we kept the latest. Note that Xerces is what's inside Oracle's JVM
(or used to be).
Memory was also considerably better using JDOM.
The modern way would be to go for StAX but that is a huge programming
change.
paul