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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.