note 16917 added to function.xml-set-character-data-handler

From: Date: Mon, 19 Nov 2001 08:34:05 +0000
Subject: note 16917 added to function.xml-set-character-data-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-20993@lists.php.net to get a copy of this message
<p> I found a simpilar solution to the multi line many function call to the data function(). My character Data handler simply saves the data as it gets called.<br> </p> function characterData($parser, $data){ global $currentData; $currentData .= $data; } <p> Then when I get an EndElement call I actually call my data function passing the entire data that I collected. Then I call my actual endElement Handler<br> </p> function endElement($parser, $name) { global $currentElement; global $currentData; if ( function_exists( $currentElement. "Data") ) { $fname = $currentElement . "Data"; $fname($currentElement, $currentData); } if ( function_exists( $name . "End") ) { $fname = $name . "End"; $fname($name); } } <p> This worked out very well for me. Jim </p> -- http://www.php.net/manual/en/function.xml-set-character-data-handler.php http://master.php.net/manage/user-notes.php?action=edit+16917 http://master.php.net/manage/user-notes.php?action=delete+16917 http://master.php.net/manage/user-notes.php?action=reject+16917

« previous php.notes (#20993) next »