Complete PHP XML Reference
The xml_set_element_handler() function specifies functions to be called at the start and end of an element in the XML document.
This function returns TRUE on success, or FALSE on failure.
| Parameter | Description |
|---|---|
| parser | Required. Specifies XML parser to use |
| start | Required. Specifies a function to be called at the start of an element |
| end | Required. Specifies a function to be called at the end of an element |
The Function specified by the "start" parameter must have three parameters:
| Parameter | Description |
|---|---|
| parser | Required. Specifies a variable containing the XML parser calling the handler |
| name | Required. Specifies a variable containing the name of the elements, that triggers this function, from the XML file as a string |
| data | Required. Specifies an array containing the elements attributes from the XML file as a string |
The Function specified by the "end" parameter must have two parameters:
| Parameter | Description |
|---|---|
| parser | Required. Specifies a variable containing the XML parser calling the handler |
| name | Required. Specifies a variable containing the name of the elements, that triggers this function, from the XML file as a string |
Note: The start and end parameters can also be an array containing an object reference and a method name.
The output of the code above will be:
Complete PHP XML Reference
Your message has been sent to W3Schools.