xml_set_unparsed_entity_decl_handler()

It  set up unparsed entity declaration handler

Example

<?php
$xmlparser=xml_parser_create();
function char($xmlparser,$data) {
echo $data;
}

function unparsed_ent_handler_func($xmlparser,$entname,$base,$sysID,$pubID,$notname){
echo $entname.$sysID.$pubID.$notname.
}

xml_set_character_data_handler($xmlparser,”char”);
xml_set_unparsed_entity_decl_handler($xmlparser,”unparsed_ent_handler_func”);

$fp=fopen(“test.xml”,”r”);

while ($data=fread($fp,4096)) {
xml_parse($xmlparser,$data,feof($fp)) or die(“Failed”);
}

xml_parser_free($xmlparser);
?>

Share