0

I am currently getting started with XML and Java. The author says that I will need DOM, SAX, JAXP and JDOM to work with the examples given.

The book states that DOM and SAX come bundled with a parser of your choice, in my case Xerses-J. I have downloaded Xerses-J (xerses-1_4_4) jar file.

so Question 1 : If I want to get started with XML and Java in Eclipse, I will only have to add the jar file xerses.jar to the build path?

Moving on to JAXP, the book says that JAXP comes with most parsers, not all. So, I want to know if it comes with Xerses-J. If not, what do I need to do?

Now, finally for JDOM. The book says that JDOM comes as a separate bundle. I downloaded it. I just need to include jdom.jar file in the build, again, right ?

I know the questions are silly but, yeah those are the questions :)

An SO User
  • 24,612
  • 35
  • 133
  • 221

1 Answers1

1

Xerces has been bundled with the JDK since (1.4?). There's no need to download and include its JAR's in project that uses a current version of the JDK. This covers you for SAX, DOM and JAXP, though you will need to download the JDOM JAR's and include them in your classpath.

On a side note, consider using Maven to manage your dependencies, it trivializes the task.

Perception
  • 79,279
  • 19
  • 185
  • 195
  • The book is an old one with code written using JDK 1.2. This was the only one available in library :) Has a lot changed ? – An SO User Apr 08 '13 at 15:32
  • Oh wow, XML processing has come a *long* way since JDK 1.2. I would recommend upgrading texts! [This book](http://www.amazon.com/Processing-XML-Java-Guide-JDOM/dp/0201771861) is one of many good ones. – Perception Apr 08 '13 at 15:36
  • A book published in 2002 will still be relevant today ? – An SO User Apr 08 '13 at 15:44
  • I would also add, that if you are planning on using JDOM, that JDOM 2.x is far easier to use in a Java5/6/7 environment, and that the book recommendation made is also out of date with respect to many of the technologies (published 2002, and the JDOM work is based on beta-code which changed a whole lot). For JDOM specific questions or help have a look at https://github.com/hunterhacker/jdom/wiki/JDOM2-A-Primer and also http://www.jdom.org/involved/lists.html – rolfl Apr 08 '13 at 15:48
  • Yep, it *is* a bit old, which makes it ironic as a recommendation. But seriously, Processing XML is one of the top texts you can read to pick up basic XML techs. As for JDOM, their are several online primers you can read to get a good handle on it. – Perception Apr 08 '13 at 15:51
  • @Perception Switching to `Pro XML Development with Java` -- was written in 2006 and for Java 6 :) – An SO User Apr 08 '13 at 17:35