<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = 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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.xml-set-start-namespace-decl-handler.php',
    1 => 'xml_set_start_namespace_decl_handler',
    2 => 'Configure le gestionnaire de d&eacute;but de d&eacute;claration de namespace',
  ),
  'up' => 
  array (
    0 => 'ref.xml.php',
    1 => 'Fonctions d\'analyse de fichier XML',
  ),
  'prev' => 
  array (
    0 => 'function.xml-set-processing-instruction-handler.php',
    1 => 'xml_set_processing_instruction_handler',
  ),
  'next' => 
  array (
    0 => 'function.xml-set-unparsed-entity-decl-handler.php',
    1 => 'xml_set_unparsed_entity_decl_handler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/xml/functions/xml-set-start-namespace-decl-handler.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">xml_set_start_namespace_decl_handler</span> &mdash; <span class="dc-title">Configure le gestionnaire de début de déclaration de namespace</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="methodname"><strong>xml_set_start_namespace_decl_handler</strong></span>(<span class="methodparam"><span class="type"><a href="class.xmlparser.php" class="type XMLParser">XMLParser</a></span> <code class="parameter">$parser</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$handler</code></span>): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   Définit le gestionnaire à appeler lorsque le namespace est déclaré.
   Les déclarations d&#039;espace de noms surviennent dans les balises de départ.
   Mais le gestionnaire de départ, appelé lors de la déclaration de l&#039;espace
   de noms, est appelé avant le gestionnaire de la balise de départ pour
   chaque espace de noms déclaré dans cette balise.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xml-set-start-namespace-decl-handler-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
 <dt><code class="parameter">parser</code></dt>
 <dd>
  <p class="para">
   Le parseur XML.
  </p>
 </dd>

    
     <dt><code class="parameter">handler</code></dt>
     <dd>
      <p class="para">
 Si <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> est passé, le gestionnaire est réinitialisé à son état par défaut.
 <div class="warning"><strong class="warning">Avertissement</strong>
  <p class="simpara">
    Une chaîne vide réinitialisera également le gestionnaire,
    cependant cette fonctionnalité est dépréciée à partir de PHP 8.4.0.
  </p>
 </div>
</p>
<p class="para">
 Si <code class="parameter">handler</code> est un <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span>,
 l&#039;appelable est défini comme le gestionnaire.
</p>
<p class="para">
 Si <code class="parameter">handler</code> est une <span class="type"><a href="language.types.string.php" class="type string">string</a></span>,
 il peut s&#039;agir du nom d&#039;une méthode d&#039;un objet défini avec
 <span class="function"><a href="function.xml-set-object.php" class="function">xml_set_object()</a></span>.
 <div class="warning"><strong class="warning">Avertissement</strong>
  <p class="simpara">
   Cette fonctionnalité est dépréciée à partir de PHP 8.4.0.
  </p>
</div>
</p>
<div class="warning"><strong class="warning">Avertissement</strong>
 <p class="simpara">
  À partir de PHP 8.4.0, la validité du callable est vérifiée lors de la configuration du gestionnaire,
  et non au moment de son appel.
  Cela signifie que <span class="function"><a href="function.xml-set-object.php" class="function">xml_set_object()</a></span> doit être appelé avant
  de définir une méthode sous forme de chaîne comme rappel.
  Cependant, comme ce comportement est également déprécié à partir de PHP 8.4.0,
  il est recommandé d&#039;utiliser un <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> approprié pour la méthode.
 </p>
</div>

      <p class="para">
       La signature du gestionnaire doit être :
       <div class="methodsynopsis dc-description"><span class="methodname"><span class="replaceable">handler</span></span>(<span class="methodparam"><span class="type"><a href="class.xmlparser.php" class="type XMLParser">XMLParser</a></span> <code class="parameter">$parser</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span> <code class="parameter">$prefix</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$uri</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

       <dl>
        
 <dt><code class="parameter">parser</code></dt>
 <dd>
  <span class="simpara">
   Le parseur XML appelant le gestionnaire.
  </span>
 </dd>

        
         <dt><code class="parameter">prefix</code></dt>
         <dd>
          <span class="simpara">
           Le préfixe est une <a href="language.types.string.php" class="link">chaîne de caractères</a> utilisée pour référencer
           le namespace d&#039;un objet XML.
           <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si aucun préfixe n&#039;existe.
          </span>
         </dd>
        
        
         <dt><code class="parameter">uri</code></dt>
         <dd>
          <span class="simpara">
           Identifiant de ressource uniforme (URI) d&#039;un
           espace de noms.
          </span>
         </dd>
        
       </dl>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xml-set-start-namespace-decl-handler-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne toujours <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.xml-set-start-namespace-decl-handler-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.4.0</td>
 <td>
  Passing a non-<span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <span class="type"><a href="language.types.string.php" class="type string">string</a></span> to
  <code class="parameter">handler</code> is now deprecated,
  use a proper callable for methods, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> to reset the handler.
 </td>
</tr>

<tr>
 <td>8.4.0</td>
 <td>
  The validity of <code class="parameter">handler</code> as a <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span>
  is now checked when setting the handler instead of checking when calling it.
 </td>
</tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">parser</code> attend une instance de <span class="classname"><a href="class.xmlparser.php" class="classname">XMLParser</a></span>
  désormais; auparavent, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">xml</code> était attendue.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.xml-set-start-namespace-decl-handler-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.xml-set-end-namespace-decl-handler.php" class="function" rel="rdfs-seeAlso">xml_set_end_namespace_decl_handler()</a> - Configure le gestionnaire de fin de d&eacute;claration de namespace</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>