Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between JAXP and JAXB?

Tags:

java

xml

What is the difference between JAXP and JAXB?

like image 830
Jothi Avatar asked May 10 '10 09:05

Jothi


People also ask

What can I use instead of JAXB?

XOM, JDOM, dom4j, etc. etc. Projects like Castor and Apache XMLBeans predate JAXB, so you could have a look at those. Ulf Dittmer wrote: XOM, JDOM, dom4j, etc.

What is JAXB API used for?

JAXB simplifies access to an XML document from a Java program by presenting the XML document to the program in a Java format. The first step in this process is to bind the schema for the XML document into a set of Java classes that represents the schema.

Is JAXB a framework?

Introduction to JAXBIt supports a binding framework that maps XML elements and attributes to Java fields and properties using Java annotations. The JAXB-2 Maven plugin delegates most of its work to either of the two JDK-supplied tools XJC and Schemagen.

What is JAXB advantage?

JAXB Advantages JAXB allows non-sequential processing of XML documents. In DOM we need to navigate a tree structure and JAXB doesn't requires such navigations. We work with java instances instead of event/elements. JAXB uses memory efficiently than DOM.


1 Answers

JAXP (Java API for XML Processing) is a rather outdated umbrella term covering the various low-level XML APIs in JavaSE, such as DOM, SAX and StAX.

JAXB (Java Architecture for XML Binding) is a specific API (the stuff under javax.xml.bind) that uses annotations to bind XML documents to a java object model.

like image 93
skaffman Avatar answered Oct 09 '22 02:10

skaffman