O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

xml.sax

The xml.sax module provides support for parsing XML documents using the SAX2 API.

make_parser ([parser_list])

Creates a new SAX parser object. To use the parser, you must set a content handler using the setContentHandler() method and then call the parse() method. The optional argument parser_list specifies a list of module names (as strings) that implement low-level XML parsers. It is rarely necessary to supply this.

parse(file, handler [, error_handler])

Parses an XML document, file. file is either the name of a file or an open file object. handler is a content handler object. error_handler is a SAX error-handler object. If omitted, errors result in a SAXParseException exception. This function works by creating a new SAX parser (using ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required