Announcement: SAX2 1999-06-01 alpha release for Java
John Cowan
cowan at locke.ccil.org
Wed Jun 2 18:05:30 BST 1999
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 at 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 at 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 at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list