'Install the callbacks needed to build the DOM into the parser.'

def install(self, parser):

    parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler
    parser.StartElementHandler = self.first_element_handler
    parser.EndElementHandler = self.end_element_handler
    parser.ProcessingInstructionHandler = self.pi_handler
    if self._options.entities:
        parser.EntityDeclHandler = self.entity_decl_handler
    parser.NotationDeclHandler = self.notation_decl_handler
    if self._options.comments:
        parser.CommentHandler = self.comment_handler
    if self._options.cdata_sections:
        parser.StartCdataSectionHandler = self.start_cdata_section_handler
        parser.EndCdataSectionHandler = self.end_cdata_section_handler
        parser.CharacterDataHandler = self.character_data_handler_cdata
    else:
        parser.CharacterDataHandler = self.character_data_handler
    parser.ExternalEntityRefHandler = self.external_entity_ref_handler
    parser.XmlDeclHandler = self.xml_decl_handler
    parser.ElementDeclHandler = self.element_decl_handler
    parser.AttlistDeclHandler = self.attlist_decl_handler
