handler objects to perform any processingyou have to supply content handler object to the parse(or parsestring(functions to define handleryou define class that inherits from contenthandler an instance of contenthandler has the following methodsall of which can be overridden in your handler class as neededc characters(contentcalled by the parser to supply raw character data content is string containing the characters enddocument(called by the parser when the end of the document is reached endelement(namecalled when the end of element name is reached for exampleif 'is parsedthis method is called with name set to 'fooc endelementns(nameqnamecalled when the end of an element involving an xml namespace is reached name is tuple of strings (urilocalnameand qname is the fully qualified name usually qname is none unless the sax namespace-prefixes feature has been enabled for exampleif the element is defined as '<foo:bar xmlns:foo="then the name tuple is ( ' endprefixmapping(prefixcalled when the end of an xml namespace is reached prefix is the name of the namespace ignorablewhitespace(whitespacecalled when ignorable whitespace is encountered in document whitespace is string containing the whitespace processinginstruction(targetdatacalled when an xml processing instruction enclosed in is encountered target is the type of instructionand data is the instruction data for exampleif the instruction is 'target is set to 'xml-stylesheetand data is the remainder of the instruction text 'href="mystyle csstype="text/css" setdocumentlocator(locatorcalled by the parser to supply locator object that can be used for tracking line numberscolumnsand other information the primary purpose of this method is simply to store the locator someplace so that you can use it later--for instanceif you needed to print an error message the locator object supplied in locator provides four methods--getcolumnnumber()getlinenumber()getpublicid()and getsystemid()--that can be used to get location information skippedentity(namecalled whenever the parser skips an entity name is the name of the entity that was skipped lib fl ff