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

Parsing a Processing Instruction

Sun Oct 26, 2008 6:57 pm

Parsing an processing instruction in php
Code:
<?php
     
function pi_handler ($p$target$data) {
        print (
$target);
        print (
$data);
     }

     
$xml "<?exec ls -l /var?><rootElement/>";
     
$p xml_parser_create ();
     
xml_set_processing_instruction_handler ($p'pi_handler');
     if (!
xml_parse ($p$xmltrue))
          die (
sprintf ("Parse error in <code>%s</code> (%s)",
                        
htmlspecialchars ($xml),
                        
xml_error_string (xml_get_error_code ($p))));
     else
          print (
"XML processing complete.\n");
     
xml_parser_free ($p);
?>




Post a reply
  Related Posts  to : Parsing a Processing Instruction
 Elements of Assembly Language Instruction     -  
 Parsing ATOM feeds     -  
 Parsing and Reading RSS feeds     -  
 Latest XML parsing/memory usage benchmark     -  
 image processing     -  
 image processing in java     -  
 thread state when it terminates its processing     -  
 image processing filters project     -  
 Image-Viewer-Image Processing-Filters-Noise-enhancements     -  

Topic Tags

PHP XML