* ]]> * * See section 4.7 of the XML 1.0 * spec for the definition of notation declarations. * * @param \XMLParser $parser The XML parser. * @param callable $handler * If NULL is passed, the handler is reset to its default state. * * * An empty string will also reset the handler, * however this is deprecated as of PHP 8.4.0. * * * * * If handler is a callable, * the callable is set as the handler. * * * If handler is a string, * it can be the name of a method of an object set with * xml_set_object. * * * This is deprecated as of PHP 8.4.0. * * * * The signature of the handler must be: * * voidhandler * XMLParserparser * stringnotation_name * stringfalsebase * stringsystem_id * stringfalsepublic_id * * * * parser * * * The XML parser calling the handler. * * * * * notation_name * * * This is the notation's name, as per * the notation format described above. * * * * * * base * * * * This is the base for resolving the system identifier * (system_id) of the notation declaration. * * * * * system_id * * * System identifier of the external notation declaration. * * * * * * public_id * * * * Public identifier of the external notation declaration. * * * * * @return bool Always returns TRUE. * */ function xml_set_notation_decl_handler(\XMLParser $parser, callable $handler): bool { error_clear_last(); $safeResult = \xml_set_notation_decl_handler($parser, $handler); return $safeResult; } /** * This function allows to use parser inside * object. All callback functions could be set with * xml_set_element_handler etc and assumed to be * methods of object. * * @param \XMLParser $parser A reference to the XML parser to use inside the object. * @param object $object The object where to use the XML parser. * @return bool Always returns TRUE. * */ function xml_set_object(\XMLParser $parser, object $object): bool { error_clear_last(); $safeResult = \xml_set_object($parser, $object); return $safeResult; } /** * Sets the processing instruction (PI) handler function for the XML parser * parser. * * A processing instruction has the following format: * * * ]]> * * * @param \XMLParser $parser The XML parser. * @param callable $handler * If NULL is passed, the handler is reset to its default state. * * * An empty string will also reset the handler, * however this is deprecated as of PHP 8.4.0. * * * * * If handler is a callable, * the callable is set as the handler. * * * If handler is a string, * it can be the name of a method of an object set with * xml_set_object. * * * This is deprecated as of PHP 8.4.0. * * * * The signature of the handler must be: * * voidhandler * XMLParserparser * stringtarget * stringdata * * * * parser * * * The XML parser calling the handler. * * * * * target * * * The processing instruction target. * * * * * data * * * The processing instruction data. * * * * * @return bool Always returns TRUE. * */ function xml_set_processing_instruction_handler(\XMLParser $parser, callable $handler): bool { error_clear_last(); $safeResult = \xml_set_processing_instruction_handler($parser, $handler); return $safeResult; } /** * Set a handler to be called when a namespace is declared. Namespace * declarations occur inside start tags. But the namespace declaration start * handler is called before the start tag handler for each namespace declared * in that start tag. * * @param \XMLParser $parser The XML parser. * @param callable $handler * If NULL is passed, the handler is reset to its default state. * * * An empty string will also reset the handler, * however this is deprecated as of PHP 8.4.0. * * * * * If handler is a callable, * the callable is set as the handler. * * * If handler is a string, * it can be the name of a method of an object set with * xml_set_object. * * * This is deprecated as of PHP 8.4.0. * * * * The signature of the handler must be: * * voidhandler * XMLParserparser * stringfalseprefix * stringuri * * * * parser * * * The XML parser calling the handler. * * * * * prefix * * * The prefix is a string used to reference the namespace within an XML object. * FALSE if no prefix exists. * * * * * uri * * * Uniform Resource Identifier (URI) of namespace. * * * * * @return bool Always returns TRUE. * */ function xml_set_start_namespace_decl_handler(\XMLParser $parser, callable $handler): bool { error_clear_last(); $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler); return $safeResult; } /** * Sets the unparsed entity declaration handler function for the XML parser * parser. * * The handler will be called if the XML parser * encounters an external entity declaration with an NDATA declaration, like * the following: * * name {publicId | systemId} * NDATA notationName * ]]> * * * See section 4.2.2 of * the XML 1.0 spec for the definition of notation declared * external entities. * * @param \XMLParser $parser The XML parser. * @param callable $handler * If NULL is passed, the handler is reset to its default state. * * * An empty string will also reset the handler, * however this is deprecated as of PHP 8.4.0. * * * * * If handler is a callable, * the callable is set as the handler. * * * If handler is a string, * it can be the name of a method of an object set with * xml_set_object. * * * This is deprecated as of PHP 8.4.0. * * * * The signature of the handler must be: * * voidhandler * XMLParserparser * stringentity_name * stringfalsebase * stringsystem_id * stringfalsepublic_id * stringfalsenotation_name * * * * parser * * * The XML parser calling the handler. * * * * * entity_name * * * The name of the entity that is about to be defined. * * * * * base * * * This is the base for resolving the system identifier * (systemId) of the external entity. * * * * * system_id * * * System identifier for the external entity. * * * * * public_id * * * Public identifier for the external entity. * * * * * notation_name * * * Name of the notation of this entity (see * xml_set_notation_decl_handler). * * * * * @return bool Always returns TRUE. * */ function xml_set_unparsed_entity_decl_handler(\XMLParser $parser, callable $handler): bool { error_clear_last(); $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler); return $safeResult; }