downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.xml-set-external-entity-ref-handler.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.xml.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.xml-set-external-entity-ref-handler.php',
   
1 => 'xml_set_external_entity_ref_handler',
  ),
 
'up' =>
  array (
   
0 => 'ref.xml.php',
   
1 => 'XML Parser Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.xml-set-end-namespace-decl-handler.php',
   
1 => 'xml_set_end_namespace_decl_handler',
  ),
 
'next' =>
  array (
   
0 => 'function.xml-set-notation-decl-handler.php',
   
1 => 'xml_set_notation_decl_handler',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.xml-set-external-entity-ref-handler" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xml_set_external_entity_ref_handler</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">xml_set_external_entity_ref_handler</span> &mdash; <span class="dc-title">Set up external entity reference handler</span></p>

 </div>
 
 <a name="function.xml-set-external-entity-ref-handler.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><b>xml_set_external_entity_ref_handler</b></span>
    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$parser</tt></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.php#language.types.callback" class="type callback">callback</a></span> <tt class="parameter">$handler</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Sets the external entity reference handler function for the XML parser
   <i><tt class="parameter">parser</tt></i>
.
  </p>
 </div>


 <a name="function.xml-set-external-entity-ref-handler.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">parser</tt></i>
</span>

     </dt><dd class="listitem">

     
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">handler</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       <i><tt class="parameter">handler</tt></i>
 is a string containing the name of a
       function that must exist when <a href="function.xml-parse.php" class="function">xml_parse()</a> is called
       for <i><tt class="parameter">parser</tt></i>
.
      </p>
      <p class="para">
       The function named by <i><tt class="parameter">handler</tt></i>
 must accept
       five parameters, and should return an integer value.If the
       value returned from the handler is <b><tt class="constant">FALSE</tt></b> (which it will be if no
       value is returned), the XML parser will stop parsing and
       <a href="function.xml-get-error-code.php" class="function">xml_get_error_code()</a> will return
       <b><tt class="constant">XML_ERROR_EXTERNAL_ENTITY_HANDLING</tt></b>.
       <div class="methodsynopsis dc-description">
         <span class="methodname"><span class="replaceable">handler</span></span>
         ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$parser</tt></span>
        , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$open_entity_names</tt></span>
        , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$base</tt></span>
        , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$system_id</tt></span>
        , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$public_id</tt></span>
        )</div>

       </p><dl>

        <dt class="varlistentry">

         <span class="term"><i><tt class="parameter">parser</tt></i>
</span>

         </dt><dd class="listitem">

          <span class="simpara">
           The first parameter, <span class="replaceable">parser</span>, is a
           reference to the XML parser calling the handler.
          </span>
         </dd>

       
        <dt class="varlistentry">

         <span class="term"><i><tt class="parameter">open_entity_names</tt></i>
</span>

         </dt><dd class="listitem">

          <span class="simpara">
           The second parameter, <i><tt class="parameter">open_entity_names</tt></i>
, is a
           space-separated list of the names of the entities that are open for
           the parse of this entity (including the name of the referenced
           entity).
          </span>
         </dd>

       
        <dt class="varlistentry">

         <span class="term"><i><tt class="parameter">base</tt></i>
</span>

         </dt><dd class="listitem">

          <span class="simpara">
           This is the base for resolving the system identifier
           (<i><tt class="parameter">system_id</tt></i>
) of the external entity.Currently
           this parameter will always be set to an empty string.
          </span>
         </dd>

       
        <dt class="varlistentry">

         <span class="term"><i><tt class="parameter">system_id</tt></i>
</span>

         </dt><dd class="listitem">

          <span class="simpara">
           The fourth parameter, <i><tt class="parameter">system_id</tt></i>
, is the
           system identifier as specified in the entity declaration.
          </span>
         </dd>

       
        <dt class="varlistentry">

         <span class="term"><i><tt class="parameter">public_id</tt></i>
</span>

         </dt><dd class="listitem">

          <span class="simpara">
           The fifth parameter, <i><tt class="parameter">public_id</tt></i>
, is the
           public identifier as specified in the entity declaration, or
           an empty string if none was specified; the whitespace in the
           public identifier will have been normalized as required by
           the XML spec.
          </span>
         </dd>

       
       </dl>
<p>
      </p>
      <p class="para">
       If a handler function is set to an empty string, or <b><tt class="constant">FALSE</tt></b>, the handler
       in question is disabled.
      </p>
      <blockquote><p><b class="note">Note</b>: <span class="simpara">Instead of a function name, an
array containing an object reference and a method name can also be
supplied.</span></p></blockquote>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.xml-set-external-entity-ref-handler.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites