Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I still be using JDOM with Java 5 or 6?

Tags:

java

xml

I've been using JDOM for general XML parsing for a long time, but get the feeling that there must be something better, or at least more lightweight, for Java 5 or 6.

There's nothing wrong with the JDOM API, but I don't like having to include Xerces with my deployments. Is there a more lightweight alternative, if all I want to do is read in an XML file or write one out?

like image 872
Mike Sickler Avatar asked Aug 27 '09 13:08

Mike Sickler


2 Answers

The best lightweight alternative is, in my opinion, XOM, but JDOM is still a very good API, and I see no reason to replace it.

It doesn't have a dependency on Xerces, though (at least, it doesn't need the Apache Xerces distro, it works alongside the Xerces that's packaged into the JRE).

like image 195
skaffman Avatar answered Sep 18 '22 00:09

skaffman


I've used the javax.xml.stream package (XMLStreamReader/XMLStreamWriter) to read and write XML using xml pull/push techniques. It's worked for me so far.

like image 44
KitsuneYMG Avatar answered Sep 21 '22 00:09

KitsuneYMG