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: "O'Brien-Strain, Eamonn" <eob AT exch.hpl.hp.com>
  • To: "'Elliotte Rusty Harold'" <elharo AT metalab.unc.edu>
  • Cc: "'xom-interest AT lists.ibiblio.org'" <xom-interest AT lists.ibiblio.org>
  • Subject: RE: [XOM-interest] Sparta: similar to XOM.
  • Date: Sun, 29 Sep 2002 12:56:16 -0700

Thanks Elliotte for all your feedback. It is very useful. I will reply to
the other messages separately.

> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo AT metalab.unc.edu]
[...]
> 1. XOM handles external entities. Sparta doesn't. This is a big
> difference for some files.

Yes you are right. This should go in the list of XOM-Sparta differences. I
plan to implement this feature in a future release because it is a pretty
simple low-impact change that fixes a significant Sparta non-compliance.

> Looking at the API, it's not clear what
> happens when you do hit an unresolved entity. Is there any
> representation of this in the tree? or do you just throw it away? or
> throw an exception?

In general, entities are not represented in the Sparta DOM tree -- they are
resolved at compile time. If the compiler hits an unresolved entity it puts
in a blank and puts a warning in the log -- it does not throw an exception.

> 2. According to your web site., "Sparta ignores namespaces. <a:Foo>
> and <b:Foo> are treated as if ":" was a normal tag character. These
> will be considered different tags even though strictly speaking there
> is a possibility that the a: and b: namespace have the same URI. (The
> Thermopylae wrapper does however support namespaces.)"
>
> This is so wrong. It rules Sparta out for so many applications. In
> 2003, without namespace support, I have to say an API is DOA. It's
> unclear how you can claim to support any of XPath, since XPath is
> completely dependent on namespaces. XPath, XSLT, XInclude, SVG, RDF,
> Schemas, XHTML, XLink, XQuery, and so many more all depend on
> namespaces.

Granted there are some applications which will rely on strict namespace
compliance, to for example deduce the precise semantics of a particular
element or attribute. But I still think that using the simple rule of
treating the ":" as a normal tag character allow you to parse the vast
majority of actual XML files out there in a way that is useful for a large
number of applications. For example, in pretty much every XML files that I
have seen the same prefixes are used for the same URIs throughout the file.

Having said that however, I think that adding namespace support is a prime
candidate for a future enhancement of Sparta, but I want to see if I can do
it without significantly increasing the code size, parsing speed, or API
complexity.

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







Archive powered by MHonArc 2.6.24.

Top of Page