PHP xml_set_external_entity_ref_handler() Function

PHP XML Parser Reference : Create an XML parser, set character data handler, set external entity reference handler, and parse an XML document

Definition and Usage

The xml_set_external_entity_ref_handler() function specifies a function to be called when the parser finds an external entity in the XML document.

Note: The handler parameter can also be an array containing an object reference and a method name.

Syntax

xml_set_external_entity_ref_handler(parser, handler)

Parameter Values

Parameter Description
parser Required. Specifies the XML parser to use
handler Required. Specifies a function to be used as an event handler. The function must accept five parameters:
  • $parser - A variable containing the XML parser calling the handler
  • $name - A variable containing the name of the external entity
  • $base - The base for resolving the system identifier (system_id) of the external entity. Currently, this is always an empty string
  • $system_id - The system identifier as specified in the entity declaration
  • $public_id - The public identifier as specified in the entity declaration

Technical Details

Return Value: TRUE on success. FALSE on failure
PHP Version: 4.0+

❮ PHP XML Parser Reference