Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

XML Cdata handler

Sun Oct 26, 2008 6:58 pm

XML Cdata handler in php
Code:
<?php
     
function cdata_handler ($parser$data) { 
        print (
$data); 
     }
     
     
$xml "<para>some character data</para>";
     
$parser xml_parser_create ();
     
xml_set_character_data_handler ($parser'cdata_handler');
     
     if (
xml_parse ($parser$xmltrue))
          print (
"Your XML document is well-formed.");
     else
          print (
"Your XML document is not well-formed.");
     
     
xml_parser_free ($parser);
?>




Post a reply
  Related Posts  to : XML Cdata handler
 Exception Handler in java     -  
 relationship an event-listener interface & event handler     -  

Topic Tags

PHP XML