[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: SAX: towards a solution
James Clark writes: > I don't think using java.util.Dictionary is a good idea: > > 1. JDK 1.2 provides a new Map interface which replaces Dictionary. > > 2. java.util.Dictionary is an abstract base class not an interface. > > 3. java.util.dictionary is weakly typed: it doesn't enforce the > requirement that keys be strings, and it requires values to be cast to > strings. > > I think it would be much better to have an Attributes interface and also > a convenience adapter class that provides a Dictionary implementation in > terms of that interface. I would like to avoid java.util.Map to keep SAX applet-friendly (it will be years before most browsers deployed support even 1.1). I agree that Dictionary is far less than ideal -- what do you imagine the attributes interface looking like? > > charData (char ch[], int length) > > I think there should be an offset argument as well. Most of the Java > String operations that operate on a subarray take 3 arguments: char > array, offset and count. Agreed. I will change it to charData (char ch[], int start, int length); > > I am also assuming that we will provide not only a callback interface, > > but also an (optional) base class with stub methods that implementors > > can override as needed; that means that novice users will not have to > > implement all of SAX, even if we do end up with nine or ten methods. > > I agree we should provide these. JDK 1.1 does this extensively in AWT: > it calls the base classes Adapters. I think we should follow this > terminology. Will the terminology translate well to other OO languages? If so, then I will be happy to use it. All the best, and thank you for the comments, David -- David Megginson ak117@f... Microstar Software Ltd. dmeggins@m... http://home.sprynet.com/sprynet/dmeggins/ xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|