Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Sparta: similar to XOM.

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "O'Brien-Strain, Eamonn" <eob AT exch.hpl.hp.com>
  • To: "'xom-interest AT lists.ibiblio.org'" <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Sparta: similar to XOM.
  • Date: Fri, 27 Sep 2002 16:45:46 -0700

Hi,

We here at HP Labs have recently released Sparta as open-source (LGPL). It
is an XML parser with a DOM API that is very reminiscent of XOM:

http://sparta-xml.sourceforge.net/

There are however some differences in the design trade-offs that each chose.

I would be interested in opinions on how XOM and Sparta compare. (Either on
this list or on the Sparta forum at
http://sourceforge.net/forum/forum.php?forum_id=202866
).

Perhaps there is something Sparta can learn from XOM or vice versa.

- o - o - o -

Like XOM, the Sparta DOM is much simpler than the standard W3C DOM. Below
are some differences that I noticed on a quick look at XOM. Please correct
me if I misunderstood anything.

* Architecture
-- Sparta is a stand-alone package with its own parser. There is an optional
wrapper that presents the W3C APIs.
-- Conversely, XOM is a wrapper around a W3C compliant parser.

* XPath.
-- Sparta allows nodes to be selected from the DOM using a subset of XPath.
-- XOM does not have XPath support (though I saw some reference to XPath as
future work)

* Namespaces:
-- Sparta does not handle namespaces specially. But it does the correct
thing in the usual case that the same prefix is always used for the same
namespace URI. (The W3C wrapper around Sparta does however implement
namespaces properly.)
-- XOM handles namespaces.

* DTD
-- Sparta does not verify DTDs
-- XOM can verify DTDs if the underlying XML parser can.

* API size. Comparing the javadocs
http://www.cafeconleche.org/XOM/doc/nu/xom/package-summary.html
http://sparta-xml.sourceforge.net/api/com/hp/hpl/sparta/package-summary.html
the two APIs are remarkably similar. Sparta has fewer DOM-related classes
because it ignores comments and processing instructions, and it treats
attributes as Strings rather than having an Attribute class.

* Compiled code size
-- sparta.jar is 42 kB (Parser, DOM, & XPath)
-- xom-1.0d3.jar is 64 kb (DOM only). The xerces parser would add about 1600
kB.

* JDK Version
-- Sparta is targeted to run on JDK 1.1.* or J2ME so that it can run on small
devices like cell phones. (Though this still needs verification.)
-- XOM needs at least JDK 1.2

__
Eamonn O'Brien-Strain
HP Labs
eob AT hpl.hp.com





Archive powered by MHonArc 2.6.24.

Top of Page