php8.5
Home/ Manual/ xml / functions/ xml_set_start_namespace_decl_handler

xml_set_start_namespace_decl_handler

PHP function Edit on GitHub ✎

(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)

Set up start namespace declaration handler

Description

xml_set_start_namespace_decl_handler(XMLParser $parser, callable|string|null $handler): true

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.

Parameters

handler

Description

The signature of the handler must be:

handler(XMLParser $parser, string|false $prefix, string $uri): void
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 Values

Always

Changelog

VersionDescription

See Also

Source: reference/xml/functions/xml-set-start-namespace-decl-handler.xml · from the official PHP manual (php/doc-en)