Skip to Content.
Sympa Menu

xom-interest - Re: [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: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: "O'Brien-Strain, Eamonn" <eob AT exch.hpl.hp.com>, "'xom-interest AT lists.ibiblio.org'" <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Sparta: similar to XOM.
  • Date: Sat, 28 Sep 2002 09:05:35 -0400

At 4:45 PM -0700 9/27/02, O'Brien-Strain, Eamonn wrote:


* 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.


Making attributes merely properties of elements instead of their own type is an interesting idea. I considered it early on for XOM, but rejected it for several reasons:

1. It made my Element API very cluttered. Element needed methods to getAttributeByName, getAttributeByNameNamespace, getAttributeType, and a few more. Since you don't track Attribute namespaces or types Sparta's API is less cluttered than XOM's would have been if it had followed this approach.

2. I saw that when XPath was eventually added, an Attribute node class would be necessary. What does Sparta do when someone passes it an XPath that selects an Attribute node or nodes?
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page