OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   SAX2: Another thought on subtyping, modification, etc.

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: "XML Developers' List" <xml-dev@ic.ac.uk>
  • Date: Fri, 21 May 1999 11:03:13 -0400 (EDT)

There have been many good suggestions on this thread about how to
proceed with SAX2 (modification vs. subtyping vs. separate
interfaces).  I was thinking about this problem last night, and it
occurred to me that the ability to query and set features and
properties might be useful not only for parsers but also for handlers, 
and perhaps for specialised data structures of some sort.  If that's
the case, then a separate interface makes a lot of sense:

  package org.xml.sax;

  public interface Configurable
  {
    public abstract void setFeature (String featureId, boolean state)
      throws SAXException;

    public abstract boolean getFeature (String featureId)
      throws SAXException;

    public abstract void setProperty (String propertyId, Object value)
      throws SAXException;

    public abstract Object getProperty (String propertyId)
      throws SAXException;
  }

In addition to filters, I can imagine general-purpose DocumentHandlers
(etc.) for things like writing XML, populating a database, etc., and
there might be value in allowing an application to query them as well.

To make life easier (and to save casting), we could also extend
Parser, etc. if people wanted to:

  public interface ConfigurableParser
    extends Parser, Configurable
  {
  }

  public interface ConfigurableDocumentHandler
    extends DocumentHandler, Configurable
  {
  }

etc.


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

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)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS