Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Which: Xerces2, dom4j, XOM, JAXP?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know which API/tool(Xerces2, dom4j, XOM, JAXP, etc.) to use for reading/writing XML files and validating XML schema?

Can I use Xerces2 since it's quite faster now?
Or use the dom4j which enhanced the well-known JDOM?
Or just use Java 1.4 JDK built-in classes?
(I'm not planning to use the JAXB since it needs compilation and installation of Web Services Developer Pack on server)

Which is the easiest and fastest?


Besides, I can't understand this comparison of the APIs:
http://www.sosnoski.com/opensrc/xmlbench/results.html

Thanks!

Regards,
Tang
I've just passed SCJP 1.4 and I'm a newbie!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there some reason you are not considering the latest version of JAXP in Java 1.5?
Unless you have a HUGE load of XML to parse I would not worry about speed at all.
The advantage of using the standard library for me is that all customers have to have is Java 1.5, no fiddling with classpaths and obscure jar files.
For better quality advice, tell us more about what you need to do!
Bill
 
Single Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's because our team uses Websphere Application Server 6.0 and it is shared by many other teams. We may not upgrade it with JDK 5.0 while they're using 1.4. (But I really want 5.0 and 6.0 is coming!)

My use of XML API are for:
a. generating hierarchical XML files from java object e.g. String, ArrayList.
b. parsing XML files from 3rd parties with XML Schema validation and then saved the data to database.

I'm looking for a easy and speedy API to use. Also I may want to figure out which is rubust, well-known standard of use it. What I researched on the API so far are:

Xerces2 is well-known, dom4j seems easier, JAXP is the standard.
But I don't know what are the difference between them.

Am I right?

Regards,
Tang
I've just passed SCJP 1.4 and I'm a newbie!
 
Marshal
Posts: 25682
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use JAXP for now. It's already included in Java 1.4. But keep on learning so that you can make your own decisions. The answer to "Which one should I use?" is "The one that's most suitable for you." At present your needs are simple, so spend your time learning how to use XML with a parser that you already have rather than falling into "analysis paralysis".
 
Single Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, for parsing and generating XML files,
JDK 1.4 contains only javax.xml.parsers.*, org.w3c.dom.*, org.xml.sax.*

Does it have too few functions to use?

(JDK 1.5 contains Xerces2 but our development team cannot use it currently!)
 
Paul Clapham
Marshal
Posts: 25682
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carry on with the answers you are getting over in the Sun forum:

http://forum.java.sun.com/thread.jspa?threadID=711960&tstart=0

I don't approve of cross-posting so I won't be answering any more in either place. Good luck with your project.
 
Single Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that many people here do not have much experiences on XML implementation.

Their exposures to different technologies are so naroow, just as their mind!
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be nice

Follow Naming policy

ps: I have tried to answer your question at the Sunforums. If you have more questions please continue to ask over there

-Raj
 
author
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at JiBX at JIBX home


I am currently using it in my project and very impressed by its flexibility and performance. Also look at the performance comparison at

performance matrix

you can complement this xsl and jaxp, if you require any transformations.

initially it requires a small learning curve but then onwards you will be productive.
 
There's a way to do it better - find it. -Edison. A better tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic