Get the App
SLTechnology News&Howtos  ›  Database  › 

Definition and usage of PHP xml_set_start_namespace_decl_handler XML parser function

Shulou Source: shulou.com Published: 2022-05-31 18:02:32 10月27日 Update

This article mainly explains "the definition and usage of PHP xml_set_start_namespace_decl_handler XML parser function". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the definition and usage of PHP xml_set_start_namespace_decl_handler XML parser function".

Definition and usage

Xml_set_start_namespace_decl_handler-sets the start namespace declaration handler

Syntax: xml_set_start_namespace_decl_handler (resource $parser, callable $handler)

Sets the handler to call when declaring a namespace. The namespace declaration appears within the opening tag. However, for each namespace declared in the opening tag, the namespace declaration is called to start the handler before starting the tag handler.

The necessary description of the parameter parameter parser is a reference to the XML parser. Handler is the handler is a string containing the name of the function that must exist when the parser calls xml_parse (). The function named by the handler must accept three arguments and should return an integer value. If the value returned from the handler is FALSE (or FALSE if no value is returned), the XML parser stops parsing and xml_get_error_code () returns XML_ERROR_EXTERNAL_ENTITY_HANDLING. : handler (resource $parser, string $prefix, string $uri)

Parser-the first parameter parser is a reference to the XML parser that calls the handler.

The prefix-prefix is a string that refers to a namespace in a XML object.

Uri-uniform resource identifier (URI) for the namespace.

If the handler function is set to an empty string or FALSE, the handler is disabled.

Note: in addition to the function name, you can also provide an array containing object references and method names. Correlation function

Xml_set_end_namespace_decl_handler ()-sets the end namespace declaration handler

Thank you for your reading, the above is the content of "definition and usage of PHP xml_set_start_namespace_decl_handler XML parser function". After the study of this article, I believe you have a deeper understanding of the definition and usage of PHP xml_set_start_namespace_decl_handler XML parser function, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Programs functions processing space parameters names tags learning content characters strings objects three prefixes that is ideas situations numeric values arrays articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS Shulou Technology Shulou Tech Info MariaDB