Java XML Xerces vs Jaxp

Posted on 2001-06-18
Last Modified: 2012-05-04
I've been looking at both of these and would like to figure out what is the difference.

1.  Ex.  In using DOM are the api calls the same for any of the libraries? Meaning If I was to use Xerces to load an xml document will the code in the jaxp be the same minus the correct libraries to call.
Meaning is the api calls the same in xerces as it is in jaxp?

2. Any opinions on which of the two offers a better performance?  I've played with Xerces 1.x but very little sample or information that its kind of hard.  In Sun's site there are allot of documentation on Jaxp.  And I read that the xerces 2.x is going to be different so does that create a new learning curve again.

Question by:borg48
  • 2
  • 2
LVL 15

Expert Comment

ID: 6201818

Author Comment

ID: 6202227
So is crimson a more up to date level library then xerces 1.0?

It seems to use the jaxp api in crimson so why not use jaxp? Any differences?

Are the api calls in jaxp the same for crimson since they both use the same dom, sax, etc level?  Meaning to open a dom document is it the same in jaxp as it is in crimson?


Expert Comment

ID: 6202336

As far as I know JAXP isn't a parser implementation. It's a set of APIs that abstract the use of XML parsers, so that you can switch parsers without changing application code (like JMS does for messaging). Apache Crimson is _one_ particular _implementation_ of an XML parser that you get with the JAXP distribution, but it's not part of the API per se.

Other XML parsers that can be "plugged into" the JAXP APIs are Apache Xerces (1/2), Sun Project X, IBM XML4J, etc.


Author Comment

ID: 6204204
Hi wbradney
  Excuse my ignorance in this but i'm just trying to clear up my understanding.  
So are  you saying that I can download the JAXP jar file and the xerces 2 jar file and program to the jaxp api.  Which in turn will use the xerces 2 api to do the actual parsing?
Is this a standard method of doing?

Does jaxp also use the xalan xslt for transformation?

Thanks for any input.

Accepted Solution

wbradney earned 50 total points
ID: 6207106

In theory, yes you should be able to use Xerces 2 through JAXP. In practice, since Xerces-2 is still very much under development, you may be disappointed.

This is what JAXP was meant to address - the abstract use of any (JAXP-compatible) XML parser, so that you can switch parsers without changing code.

As far as I know JAXP does not address XSLT, just XML parsing.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Group all sequential comments all in one binder <p>, using XSL 10 45
microsoft access - xml 10 73
XML & .net 5 48
AL3 Files 4 38
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question