tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: (off topic) XML to Java and viceversa.
Date Mon, 28 Apr 2003 12:38:08 GMT

Howdy,
Sorry about the wrong JDOM link -- the evils of cut and paste while
eating!

>What is the difference between DOM and JDOM.

DOM = a specification, a set of interfaces.

JDOM = a DOM implementation with a lot of addons.

>What is better? Castor or JABX. I do not understand the difference. do
they
>do the same thing.

JAXB can be viewed as a specification, like JAXP, which also comes with
Sun's own implementation.  Castor is a stand-alone product.  Ideally,
Castor would be an implementation of the JAXB interfaces, and in fact
this may well happen in the future.

So with JAXP for XML parsing, you use only JAXP classes in your code.
Things like SAXParserFactory, SAXParser, DOM's Document, etc.  These are
all abstract classes or interfaces.  The factory creates instances of
concrete parsers, e.g. from Crimson or Xerces, to do the actual work,
but your code doesn't explicitly refer to these implementation-specific
classes.  The win here is the ability to switch parsing implementations
without changing the code.

JAXB aims to do the same thing.

With Castor, you have to import its proprietary classes and an
implementation change will required code changes in your app.

So which one is better?  At this point, JAXB is not very mature, so I'd
say the two are about equal, and Castor may be better.  Try them both
and see which one you like.  But if JAXB proves as successful as JAXP
(which I'm sure some people on this list remember got off to a
sputtering start at best), I think JAXB will be the way to go and I'm
sure Castor will provide a JAXB implementation package.

>Where can I get good examples? I just want to map and xml file which
comply
>an schema with and object
>that I have already created.

The sites for all the above have good examples.  The JWSDP download
comes with tutorials for all its components, including a very good JAXB
tutorial.  Castor has great docs as well.

>Where can I get the jars from?

Links were provided in previous messages on this thread.

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message