What's the difference of JAXP, JDOM, DOM4J,and XERCES?

Y.L. picture Y.L. · Sep 18, 2012 · Viewed 11.1k times · Source

What is the difference of them? It is said that JAXP is only a API Specification, JDOM and DOM4J realized it, is it right? And all of them need a XML parser, just like XERCES, is it right? thanks in advance!

Answer

bdoughan picture bdoughan · Sep 18, 2012

JAXP (JSR-206)

Is a set of standard APIs for Java XML parsers. It covers the following areas:

  • DOM (org.w3c.dom package)
  • SAX (org.xml.sax package)
  • StAX/JSR-173 (java.xml.stream)
  • XSLT (javax.xml.transform)
  • XPath (javax.xml.xpath)
  • Validation (javax.xml.validation)
  • Datatypes (javax.xml.datatype)

This standard was created by an expert group with representatives from many companies and individuals. As a standard this means there are multiple implementations (Xerces implements JAXP), and it can be included in the JDK.

Xerces

Is an open source Java XML parser that provides DOM and SAX implementations that are compliant with the JAXP standard.

JDOM and DOM4J

Are open source Java XML parsers.