PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

xml_set_start_namespace_decl_handler> <xml_set_object
Last updated: Fri, 11 Apr 2008

view this page in

xml_set_processing_instruction_handler

(PHP 4, PHP 5)

xml_set_processing_instruction_handler — Indica il gestore delle istruzioni di processo (PI)

Descrizione

bool xml_set_processing_instruction_handler ( resource $parser , callback $gestore )

Indica al parser XML parser la funzione per la gestione delle istruzioni di processo (PI). Il gestore è una stringa contenente il nome di una funzione che deve esistere quando viene eseguita la funzione xml_parse() per il parser .

Le istruzioni di processo hanno il seguente formato:

<?
       
target data
?>
      
Si può inserire codice PHP all'interno di questo tipo di tag, ma occorre fare attenzione ad una limitazione: in una PI XML, il tag di fine PI (?>) non può essere tra apici, pertanto questa seguenza di caratteri non dovrebbe apparire nel codice PHP che si inserisce nel documento XML con le PIs. Se ciò accade il resto del codice PHP, come il "reale" tag di fine PI, saranno trattati come caratteri di dati.

La funzione indicata da gestore deve accettare tre parametri:

gestore ( resource $parser , string $target , string $dati )
parser
Il primo parametro, parser, è il riferimento al parser XML chiamante il gestore.
target
Il secondo parametro, target , contiene la PI target.
dati
Il terzo parametro, dati , contiene i dati del PI.

Se il nome della funzione del gestore viene valorizzato con una stringa vuota oppure a FALSE, il gestore in questione viene disabilitato.

La funzione restituisce TRUE se il gestore viene attivato, FALSE se parser non indica un parser XML.

Nota: Invece di un nome di funzione, può essere passato anche un array contenente un riferimento ad oggetto e un nome di metodo.



add a note add a note User Contributed Notes
xml_set_processing_instruction_handler
There are no user contributed notes for this page.

xml_set_start_namespace_decl_handler> <xml_set_object
Last updated: Fri, 11 Apr 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites