xml_set_default_handler

(PHP 4, PHP 5, PHP 7, PHP 8)

xml_set_default_handlerSet up default handler

Descrição

xml_set_default_handler(XMLParser$parser, callable$handler): true

Sets the default handler function for the XML parser parser.

Parâmetros

parser

O analisador XML.

handler

Se null ou uma string vazia for passada, o manipulador será redefinido para seu estado padrão.

Se handler for um callable, o callable será definido como o manipulador.

Se handler for uma string, ela pode ser o nome de um método de um objet definido com xml_set_object().

The signature of the handler must be:

handler(XMLParser$parser, string$data): void
parser
O analisador XML que chama o manipulador.
data
data contains the character data. This may be the XML declaration, document type declaration, entities or other data for which no other handler exists.

Valor Retornado

Sempre retorna true.

Registro de Alterações

VersãoDescrição
8.0.0 O parâmetro parser agora espera uma instância de XMLParser; anteriormente, um resourcexml válido era esperado.
To Top