PHP Function XML_Set_Element_Handler
The php function xml_set_element_handler allows you to control how a document is parsed and formatted on an event basis. For example, it lets you set a callback function to be called when the parser encounters the beginning of an element tag, or when it finds the end of one. The handler functions you provide can manipulate the data in any way that you want.
When you first create an XML parser, you can also specify a source encoding for the document to be processed. The supported encodings are ISO-8859-1, US-ASCII and UTF-8. If a document is supplied in an encoding that is not specified, the XML parser will fall back to ISO-8859-1.
In XML documents, attribute names and values are case-folded by default. This is a convenience feature to allow you to access an XML document's attributes in a more readable manner. If you use a callback function for each start and end element tag, then you may need to know the original case of the attribute to use it properly in your application.
The xml_set_element_handler() and xml_set_character_data_handler() functions take the following parameters: a reference to the XML parser created in the call to xml_parser_create, a function prototype for the start element handler (to be called when an XML opening tag is found), and a function prototype for the end element handler (to be called when an