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 ...

Get Python: Essential Reference, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.