[XML-SIG] SAX2: Extended parser interface

Lars Marius Garshol larsga@ifi.uio.no
28 Mar 1999 16:30:20 +0200


This is the proposed extended parser interface. It uses globally
unique IDs for features, handlers and properties, based on URLs (just
like namespaces do).

The IDs will be dealt with separately.


class Parser2(Parser):

  def setFeature(featureID, state)
    This turns on or off (depending on whether state is true or false)
    support for a particular feature (like namespaces, validation etc).
    The parser can raise SAXNotSupportedException if it doesn't
    support the feature or its subclass SAXUnrecognizedException.

  def setHandler(handlerID, handler):
    This registers an event handler with the parser (LexicalHandler,
    NamespaceHandler or maybe some special parser-defined handler).
    The parser can raise SAXNotSupportedException if it doesn't
    support the handler or its subclass SAXUnrecognizedException.

  def set(propertyID, value):
    This sets the value of a parser property (such as the namespace
    separator string or something parser-defined.) The parser can
    raise SAXNotSupportedException if it doesn't support the handler
    or its subclass SAXUnrecognizedException.

  def get(propertyID):   
    This returns the value of a property. The parser can raise
    SAXNotSupportedException if it doesn't support the handler or its
    subclass SAXUnrecognizedException.