Complete PHP XML Reference
The xml_set_default_handler() function sets the default data handler for the XML parser.
This function specifies what function to be called whenever the parser finds data in the XML file.
This function returns TRUE on success, or FALSE on failure.
| Parameter | Description |
|---|---|
| parser | Required. Specifies XML parser to use |
| handler | Required. Specifies a function to be used as an event handler |
The Function specified by the "handler" parameter must have two
parameters:
| Parameter | Description |
|---|---|
| parser | Required. Specifies a variable containing the XML parser calling the handler |
| data | Required. Specifies a variable containing the data from the XML file as a string |
Note: The data_handler parameter can also be an array containing an object reference and a method name.
XML File
PHP Code
The output of the code above will be:
If you select "View source" in the browser window, you will see the following HTML:
Complete PHP XML Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|