Dutch PHP Conference 2025 - Call For Papers

xml_set_start_namespace_decl_handler

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

xml_set_start_namespace_decl_handler Set up start namespace declaration handler

Опис

xml_set_start_namespace_decl_handler(XMLParser $parser, callable $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.

Параметри

parser

XML-парсер.

handler

Якщо задано null або порожній рядок, обробник буде відновлено до його початкового стану.

Якщо параметр handler має тип callable, то обробником стане функція/метод, що має таку назву виклику.

Параметру handler дозволяється мати тип string, якщо це назва метода об'єкта, встановленого функцією xml_set_object().

The signature of the handler must be:

handler(XMLParser $parser, string|false $prefix, string $uri): void
parser
XML-парсер, якого викликатиме обробник.
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.

Значення, що повертаються

Завжди повертає true.

Журнал змін

Версія Опис
8.0.0 Тепер параметр parser має бути примірником XMLParser. Раніше очікувався xml-resource.

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top