Lists Home |
Date Index |
- From: John Cowan <firstname.lastname@example.org>
- To: XML Dev <email@example.com>
- Date: Wed, 02 Jun 1999 11:38:56 -0400
David Megginson wrote:
> 1. Do we need a filter *interface* at all, or can a filter just be a
> class that happens to implement Parser, Configurable,
> EntityResolver, DTDHandler, DocumentHandler, and ErrorHandler?
Actually, a parser filter only *has* to implement Parser. Whether
it implements the other things, or delegates their implementation
to private objects, is a detail.
> other words, is it enough to set the parent parser/filter in the
IMHO yes. One could use reflection to determine whether there is
such a constructor, at least in the Java domain.
> 2. Actually, just last night I wrote an
> org.xml.sax.helpers.FilterAdapter base class that filters can
> easily be derived from (though they wouldn't have to be); by
> default, it just lets all events sink down to the application,
> and all configuration bubble up to the parser, but subclasses can
> simply override methods to make changes in either direction.
I suggest you look at my P.D. code at
http://www.ccil.org/~cowan/XML/ParserFilter.java; it would be easy to
enhance it for SAX2, and it handles some subtle points.
John Cowan http://www.ccil.org/~cowan firstname.lastname@example.org
You tollerday donsk? N. You tolkatiff scowegian? Nn.
You spigotty anglease? Nnn. You phonio saxo? Nnnn.
Clear all so! 'Tis a Jute.... (Finnegans Wake 16.5)
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)