Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 6642

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>Set up start namespace declaration handler</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xml-set-processing-instruction-handler.html">xml_set_processing_instruction_handler</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xml-set-unparsed-entity-decl-handler.html">xml_set_unparsed_entity_decl_handler</a></div>
 <div class="up"><a href="ref.xml.html">XML Parser Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.xml-set-start-namespace-decl-handler" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xml_set_start_namespace_decl_handler</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5)</p><p class="refpurpose"><span class="refname">xml_set_start_namespace_decl_handler</span> &mdash; <span class="dc-title">
   Set up start namespace declaration handler
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.xml-set-start-namespace-decl-handler-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>xml_set_start_namespace_decl_handler</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$parser</code></span>
   , <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$handler</code></span>
   )</div>

  <p class="para rdfs-comment">
   Set a handler to be called when a namespace is declared. Namespace
   declarations occur inside start tags. But the namespace declaration start
   handler is called before the start tag handler for each namespace declared
   in that start tag.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xml-set-start-namespace-decl-handler-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">parser</code></em></span>
     <dd>

      <p class="para">
       A reference to the XML parser.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">handler</code></em></span>
     <dd>

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

       <dl>

        <dt>

         <span class="term"><em><code class="parameter">parser</code></em></span>
         <dd>

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

        </dt>

        <dt>

         <span class="term"><em><code class="parameter">prefix</code></em></span>
         <dd>

          <span class="simpara">
           The prefix is a string used to reference the namespace within an XML object.
          </span>
         </dd>

        </dt>

        <dt>

         <span class="term"><em><code class="parameter">uri</code></em></span>
         <dd>

          <span class="simpara">
           Uniform Resource Identifier (URI) of namespace.
          </span>
         </dd>

        </dt>

       </dl>

      </p>
      <p class="para">
       If a handler function is set to an empty string, or <strong><code>FALSE</code></strong>, the handler
       in question is disabled.
      </p>
      <blockquote class="note"><p><strong class="note">Note</strong>: <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>

    </dt>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.xml-set-start-namespace-decl-handler-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.xml-set-start-namespace-decl-handler-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.xml-set-end-namespace-decl-handler.html" class="function" rel="rdfs-seeAlso">xml_set_end_namespace_decl_handler()</a> - Set up end namespace declaration handler</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.xml-set-processing-instruction-handler.html">xml_set_processing_instruction_handler</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.xml-set-unparsed-entity-decl-handler.html">xml_set_unparsed_entity_decl_handler</a></div>
 <div class="up"><a href="ref.xml.html">XML Parser Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>