I have the same issue using two installation of PHP5: on accepts to use the default handler while the other only uses the character_data one.
Maybe a configuration problem...
;) Nonor.
xml_set_default_handler
(PHP 4, PHP 5)
xml_set_default_handler — Imposta il gestore predefinito
Descrizione
Imposta la funzione di gestione predefinita per il parser XML
parser.
Elenco dei parametri
-
parser -
Un riferimento al parser XML per impostare la funzione di gestione predefinita.
-
handler -
handlerè una stringa che contiene il nome di una funzione che deve esistere quando xml_parse() è chiamata perparser.La funzione indicata da
handlerdeve accettare due parametri:handler ( resource$parser, string$data)-
parser - Il primo parametro, parser, è un riferimento al parser XML che chiama il gestore.
-
data -
Il secondo parametro,
data, contiene i dati carattere.Questo può essere la dichiarazione XML, la dichiarazione del tipo del documento, entità o altri dati per i quali non esistono altri gestori.
Se una funzione del gestore è impostata con una stringa vuota, oppure a
FALSE, il gestore in questione viene disabilitato.Nota: Invece di un nome di funzione, può essere passato anche un array contenente un riferimento ad oggetto e un nome di metodo.
-
Valori restituiti
Restituisce TRUE in caso di successo, FALSE in caso di fallimento.
it seems to me that in PHP5 the function defined as default-handler (using xml_set_default_handler()) doesen't get passed the cdata anymore:
i.e.:
xml_set_element_handler($this->parser, 'parseSTART', 'parseEND');
xml_set_default_handler($this->parser, 'parseDEFAULT');
function parseSTART() { ... }
function parseEND() { ... }
function parseDEFAULT() { ... }
under PHP5, parseDEFAULT will NOT get passed any cdata, but unter PHP4 it will. at least that's my take on the strange stuff (not) happening after migrating to PHP5.
my solution was to add a xml_set_character_data_handler($parser, 'parseDEFAULT'). it worked for me.
