[XML-SIG] SAX in Python 1.6

Paul Prescod paul@prescod.net
Fri, 30 Jun 2000 11:06:52 -0500


> IMHO we should use the namespace support that is built-in to expat.
> Anything else is bound to slow us down.

Unfortunately expat's namespaces support is broken from the point of
view of SAX and DOM. 

> Whoops! parseFile() no longer exists! We now use the InputSource class
> instead. 

InputSource seemed like overkill to me. More of a Java-ish type safety
thing. I'd appreciate your opinion.

In my opinion, parse() should accept a string or a stream. If a string,
it should be treated as a URL or filename and opened.

We will also provide a convenience method parseString() that parses an
XML string (probably by wrapping it in a cStringIO. Also Fred was
talking about convenience functions we devised of the form:

__init__.py:

parse( file, handler=None ):
	import pyexpat
	parser=CreateParser()
	parser.setContentHandler( handler )
	parser.parse( file )

parse( string, handler=None ):
	import pyexpat
	parser=CreateParser()
	parser.setContentHandler( handler )
	parser.parse( file )

These convenience functions are not in the package we sent up yesterday.

> |                 saxutils        # pretty much the same as now
> Probably not. There's a lot of SAX 1.0 legacy there now. That would
> need to be removed. 

It has been removed.

-- 
 Paul Prescod - Not encumbered by corporate consensus
The calculus and the rich body of mathematical analysis to which it 
gave rise made modern science possible, but it was the algorithm that 
made the modern world possible.
	- The Advent of the Algorithm (pending), by David Berlinski