xml.parsers.expat.xmlparser.StartNamespaceDeclHandler()

xmlparser.StartNamespaceDeclHandler(prefix, uri) Called when an element contains a namespace declaration. Namespace declarations are processed before the StartElementHandler is called for the element on which declarations are placed.

xml.parsers.expat.xmlparser.StartElementHandler()

xmlparser.StartElementHandler(name, attributes) Called for the start of every element. name is a string containing the element name, and attributes is the element attributes. If ordered_attributes is true, this is a list (see ordered_attributes for a full description). Otherwise it’s a dictionary mapping names to values.

xml.parsers.expat.xmlparser.StartDoctypeDeclHandler()

xmlparser.StartDoctypeDeclHandler(doctypeName, systemId, publicId, has_internal_subset) Called when Expat begins parsing the document type declaration (<!DOCTYPE ...). The doctypeName is provided exactly as presented. The systemId and publicId parameters give the system and public identifiers if specified, or None if omitted. has_internal_subset will be true if the document contains and internal document declaration subset. This requires Expat version 1.2 or newer.

xml.parsers.expat.xmlparser.StartCdataSectionHandler()

xmlparser.StartCdataSectionHandler() Called at the start of a CDATA section. This and EndCdataSectionHandler are needed to be able to identify the syntactical start and end for CDATA sections.

xml.parsers.expat.xmlparser.specified_attributes

xmlparser.specified_attributes If set to a non-zero integer, the parser will report only those attributes which were specified in the document instance and not those which were derived from attribute declarations. Applications which set this need to be especially careful to use what additional information is available from the declarations as needed to comply with the standards for the behavior of XML processors. By default, this attribute is false; it may be changed at any time.

xml.parsers.expat.xmlparser.SetParamEntityParsing()

xmlparser.SetParamEntityParsing(flag) Control parsing of parameter entities (including the external DTD subset). Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and XML_PARAM_ENTITY_PARSING_ALWAYS. Return true if setting the flag was successful.

xml.parsers.expat.xmlparser.SetBase()

xmlparser.SetBase(base) Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the ExternalEntityRefHandler(), NotationDeclHandler(), and UnparsedEntityDeclHandler() functions.

xml.parsers.expat.xmlparser.ProcessingInstructionHandler()

xmlparser.ProcessingInstructionHandler(target, data) Called for every processing instruction.

xml.parsers.expat.xmlparser.ParseFile()

xmlparser.ParseFile(file) Parse XML data reading from the object file. file only needs to provide the read(nbytes) method, returning the empty string when there’s no more data.

xml.parsers.expat.xmlparser.Parse()

xmlparser.Parse(data[, isfinal]) Parses the contents of the string data, calling the appropriate handler functions to process the parsed data. isfinal must be true on the final call to this method; it allows the parsing of a single file in fragments, not the submission of multiple files. data can be the empty string at any time.