Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Canonicalizer API

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <jcowan AT reutershealth.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Canonicalizer API
  • Date: Mon, 7 Feb 2005 17:37:05 -0500

Elliotte Harold scripsit:

> The public API for nu.xom.Canonicalizer is getting increasingly unwieldy
> as I add more and more options. It's time for a serious rethink. I don't
> think this will affect the public API from 1.0 in any backwards
> incompatible way. However, I do want to think about what the much more
> configurable 1.1 API will look like.

You're right that the current 1.1 API is a mess. I'd go to a simple
constructor that only specifies the OutputStream, and then have methods
to set various features and properties: setExclusiveMode(boolean b),
getExclusiveMode(), setCommentsMode(boolean b), getCommentsMode(),
setAlgorithm(String algorithm), getAlgorithm().

In this way, each feature has only a linear cost rather than an
exponential one. (You could also use the SAX feature approach with URIs,
but I think it's overkill, required in SAX because SAX is an interface
and can't have an open-ended API.)

--
John Cowan jcowan AT reutershealth.com www.reutershealth.com
www.ccil.org/~cowan
"The exception proves the rule." Dimbulbs think: "Your counterexample proves
my theory." Latin students think "'Probat' means 'tests': the exception puts
the rule to the proof." But legal historians know it means "Evidence for an
exception is evidence of the existence of a rule in cases not excepted from."




Archive powered by MHonArc 2.6.24.

Top of Page