• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between JAXB and JAXP

 
Thanammal A
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi than mmal ,

Welcome to JavaRanch . I guess you may have to update your display name according to the Ranch's naming policy listed here.

JAXB stands for Java Architecture for XML Binding - as it is used to prepare an equivalent Java object for the XML structure you pass and vice versa through its processes called Marshalling and Unmarshalling.



JAXP stands for Java API for XML Parsing. It is used to parse the XML structure you give. There are two main parsers named DOM and SAX and they have their own pros and cons (+ves and -ves). JAXP helps you to read through the XML document and do some appropriate business actions based on the content.



Hope this helps! You can read more on this in J2EE online documentation (J2EE tutorial) and in Java WebServices tutorial. Just google on it.

[Change] -> Modified the abbreviation of the term JAXB.
[ July 08, 2008: Message edited by: Raghavan Muthu ]
 
Thanammal A
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muthu, you rock !!!
 
nav katoch
Ranch Hand
Posts: 246
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Co-rancher,

Thanks for the nice explanation. I read somewhere that JAXB stands for Java Architecture for XML Binding. Please re-clarify.

Thanks,

Naveen Katoch
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by nav katoch:


Thanks for the nice explanation. I read somewhere that JAXB stands for Java Architecture for XML Binding. Please re-clarify.


That's correct Naveen. Thank you for correcting! I have adjusted the earlier post!!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

Raghavan said -

"There are two main parsers named DOM and SAX and they have their own pros and cons (+ves and -ves)."

Please note that XSLT is also part of JAXP. http://en.wikipedia.org/wiki/Java_API_for_XML_Processing explains it well.

Regards,
Dan
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Dan! I think it has got recently added into the JAXP stack!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Day,

When I come to think about this -

What does JAXP add in addition to offering DOM, SAX and XSLT under one roof?

Regards,
Dan
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mainly it provides a parser-independent way to obtain SAX or DOM implementations. Before JAXP, each parser had its own wat to provide access to them, so code couldn't trivially be changed to use a particular parser instead of some other.

The latest versions of JAXP also provide support for XPath and StaX.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic