On Jan 27, 2008 5:40 PM, Eric Lease Morgan <[log in to unmask]> wrote:
> What is the most respected (useful, understandable) XML Java package?
> In a few fits of creative rage, I have managed to write my first Java
> programs. I can now index plain text files with Lucene and search the
> index. I can parse MARC files with MARC4J, index them with Lucene,
> and search the index. I can dump the results of the OAI-PMH
> ListRecords and Identify verbs using harvest2 from OCLC.
> I now need to read XML. Unlike indexing and doing OAI-PMH, there are
> a myriad of tools for reading and writing XML. I've done SAX before.
> I think I've done a bit of DOM. If I wanted a straight-forward and
> well-supported Java package that supported these APIs, then what
> package might I use?
If the data you're manipulating is partially or fully described by a
Schema or DTD, consider using a package such as Castor (castor.org)
that generates classes that stores you XML data as Java beans. In this
case, you get XML parsing, XML generation, and even validation for
free, that is, using only about 3 lines of code. If you don't have a
Schema, considering creating one or asking the data provider for one -
compared to using SAX or compared to using a DOM-like API, the gain in
productivity and robustness is significant.
We're using Castor extensively in the LibX edition builder - for our
own configuration data, which is stored as XML, but also for accessing
a number of OCLC services, including the OpenURL registry (which has a
complete Schema!), the Worldcat registry (partial schema for SRW), and
the OCLC institution profiles (no Schema :-(, so slightly more