[XML-SIG] A first attempt at a SAX 2.0 draft
Lars Marius Garshol
03 Mar 2000 08:45:18 +0100
* Lars Marius Garshol
| # ===== PARSER =====
| class Parser:
| """Basic interface for SAX (Simple API for XML) parsers. All SAX
| parsers must implement this basic interface: it allows users to
| register handlers for different types of events and to initiate a
| parse from a URI, a character stream, or a byte stream. SAX
| parsers should also implement a zero-argument constructor."""
| def parse(self, systemId):
| "Parse an XML document from a system identifier."
| def parseFile(self, fileobj):
| "Parse an XML document from a file-like object."
* Ken MacLeod
| This should probably also have a parseCharacterStream() for upcoming
| support of Unicode.
XMLReader (the SAX 2.0 replacement for Parser) does this by accepting
an InputSource object. Parser is obsolete now, but I've kept it for
backwards compatibility (adapter classes will appear later, like in
Java SAX). The question is whether we should extend it to accept an
InputSource as the argument of 'parse'.