[
Lists Home |
Date Index |
Thread Index
]
- From: John Cowan <cowan@locke.ccil.org>
- To: XML Dev <xml-dev@ic.ac.uk>
- 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.
> (In
> other words, is it enough to set the parent parser/filter in the
> constructor?)
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 cowan@ccil.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:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)
|