Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Shemp: an XMLFilter for use with 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: John Cowan <cowan AT mercury.ccil.org>
  • Cc: Xom Interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Shemp: an XMLFilter for use with XOM
  • Date: Fri, 18 Jul 2003 00:01:29 -0400

At 10:29 AM -0400 6/18/03, Elliotte Rusty Harold wrote:

Attributes are tricky. I can't really allow an Attribute to replace an Element without extra instanceof tests that are insanely expensive.

Now that I've removed all instanceof tests from the nu.xom package, this might be fast enough to consider. I'll need to test it.

Plus returning the attribute instead of an element, it would be very tricky to figure out the appropriate value of the attribute. I guess the factory would have to hang on to a reference to the Attribute object, and then accumulate text until it saw the end of the element, and then set the value. Messy, but doable.

Maybe this isn't so bad. If startMakingElement returns an Attribute, then the attribute is added to the parent and the rest of the content is added to the parent as well. If finishMakingElement returns an Attribute, then the attribute is added to the parent and the rest of the content is deleted. In both cases this is similar to returning null.

In all cases, there'd have to be the possibility of an exception if you returned something that just couldn't work (e.g. a text node in the prolog) but maybe that's OK. I'm not convinced this is a common need, but if it could be easily enabled without complexifying or slowing down the API, then it might be a nice feature to have.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



  • Re: [XOM-interest] Shemp: an XMLFilter for use with XOM, Elliotte Rusty Harold, 07/18/2003

Archive powered by MHonArc 2.6.24.

Top of Page