<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Event Handlers</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xml.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="xml.case-folding.html">Case Folding</a></div> <div class="up"><a href="book.xml.html">XML Parser</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="xml.eventhandlers" class="article"> <h1>Event Handlers</h1> <p class="para"> The XML event handlers defined are: <table class="doctable table"> <caption><strong>Supported XML handlers</strong></caption> <thead> <tr> <th>PHP function to set handler</th> <th>Event description</th> </tr> </thead> <tbody class="tbody"> <tr> <td> <span class="function"><a href="function.xml-set-element-handler.html" class="function">xml_set_element_handler()</a></span></td> <td> Element events are issued whenever the XML parser encounters start or end tags. There are separate handlers for start tags and end tags. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-character-data-handler.html" class="function">xml_set_character_data_handler()</a></span> </td> <td> Character data is roughly all the non-markup contents of XML documents, including whitespace between tags. Note that the XML parser does not add or remove any whitespace, it is up to the application (you) to decide whether whitespace is significant. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-processing-instruction-handler.html" class="function">xml_set_processing_instruction_handler()</a></span> </td> <td> PHP programmers should be familiar with processing instructions (PIs) already. <?php ?> is a processing instruction, where <span class="replaceable">php</span> is called the "PI target". The handling of these are application-specific, except that all PI targets starting with "XML" are reserved. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-default-handler.html" class="function">xml_set_default_handler()</a></span></td> <td> What goes not to another handler goes to the default handler. You will get things like the XML and document type declarations in the default handler. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-unparsed-entity-decl-handler.html" class="function">xml_set_unparsed_entity_decl_handler()</a></span> </td> <td> This handler will be called for declaration of an unparsed (NDATA) entity. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-notation-decl-handler.html" class="function">xml_set_notation_decl_handler()</a></span> </td> <td> This handler is called for declaration of a notation. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-external-entity-ref-handler.html" class="function">xml_set_external_entity_ref_handler()</a></span> </td> <td> This handler is called when the XML parser finds a reference to an external parsed general entity. This can be a reference to a file or URL, for example. See <a href="example.xml-external-entity.html" class="link">the external entity example</a> for a demonstration. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-start-namespace-decl-handler.html" class="function">xml_set_start_namespace_decl_handler()</a></span> </td> <td> This handler is called for the start of a namespace declaration. </td> </tr> <tr> <td> <span class="function"><a href="function.xml-set-end-namespace-decl-handler.html" class="function">xml_set_end_namespace_decl_handler()</a></span> </td> <td> This handler is called for the end of a namespace declaration. Note that this event is <em class="emphasis">NOT</em> under LibXML. </td> </tr> </tbody> </table> </p> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xml.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="xml.case-folding.html">Case Folding</a></div> <div class="up"><a href="book.xml.html">XML Parser</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>