<?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-parser-set-option.php',
    1 => 'xml_parser_set_option',
    2 => 'Affecte les options d\'un analyseur XML',
  ),
  'up' => 
  array (
    0 => 'ref.xml.php',
    1 => 'Fonctions d\'analyse de fichier XML',
  ),
  'prev' => 
  array (
    0 => 'function.xml-parser-get-option.php',
    1 => 'xml_parser_get_option',
  ),
  'next' => 
  array (
    0 => 'function.xml-set-character-data-handler.php',
    1 => 'xml_set_character_data_handler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/xml/functions/xml-parser-set-option.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.xml-parser-set-option" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xml_parser_set_option</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">xml_parser_set_option</span> &mdash; <span class="dc-title">Affecte les options d&#039;un analyseur XML</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.xml-parser-set-option-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>xml_parser_set_option</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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$option</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.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$value</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Affecte les options d&#039;un analyseur XML.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xml-parser-set-option-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">parser</code></dt>
     <dd>
      <p class="para">
       Une référence vers un analyseur XML.
      </p>
     </dd>
    
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       L&#039;option à modifier. Voir ci-dessous.
      </p>
      <p class="para">
       Les options suivantes sont disponibles :
       <table class="doctable table">
        <caption><strong>Options de l&#039;analyseur XML</strong></caption>
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Type de données</th>
           <th>Description</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><strong><code><a href="xml.constants.php#constant.xml-option-case-folding">XML_OPTION_CASE_FOLDING</a></code></strong></td>
           <td>bool</td>
           <td>
            Contrôle la gestion de la <a href="xml.case-folding.php" class="link">casse</a>
            des balises de cet analyseur XML. Par défaut, activé.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="xml.constants.php#constant.xml-option-parse-huge">XML_OPTION_PARSE_HUGE</a></code></strong></td>
           <td>bool</td>
           <td>
            Permet d&#039;analyser des documents de plus de 10 Mo.
            Cette option ne doit être activée que si la taille du document est
            limitée, car cela pourrait sinon conduire à une attaque par déni de service (DoS).
            Cette option est uniquement disponible avec l&#039;utilisation de libxml2.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="xml.constants.php#constant.xml-option-skip-tagstart">XML_OPTION_SKIP_TAGSTART</a></code></strong></td>
           <td>integer</td>
           <td>
            Spécifie combien de caractères doivent être éludés du début du nom de la balise.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="xml.constants.php#constant.xml-option-skip-white">XML_OPTION_SKIP_WHITE</a></code></strong></td>
           <td><a href="language.types.integer.php" class="link">entier</a></td>
           <td>
            Élude ou non les valeurs contenant des caractères blancs.
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="xml.constants.php#constant.xml-option-target-encoding">XML_OPTION_TARGET_ENCODING</a></code></strong></td>
           <td>string</td> 
           <td>
            Modifie le <a href="xml.encoding.php" class="link">codage à la cible</a>
            utilisé par cet analyseur XML. Par défaut, c&#039;est celui
            qui a été spécifié lors de l&#039;appel de
            <span class="function"><a href="function.xml-parser-create.php" class="function">xml_parser_create()</a></span>. Les codages supportés
            sont <code class="literal">ISO-8859-1</code>, <code class="literal">US-ASCII</code>
            et <code class="literal">UTF-8</code>.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       La nouvelle valeur de l&#039;option.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xml-parser-set-option-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Renvoie <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> en cas d&#039;échec.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.xml-parser-set-option-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   Lève une <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> lorsqu&#039;une valeur invalide est passée
   à <code class="parameter">option</code>.
  </p>
  <p class="para">
   Antérieur à PHP 8.0.0, passer une valeur invalide à <code class="parameter">option</code>
   générait un avertissement <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
   et faisait retourner à la fonction la valeur <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.xml-parser-set-option-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>
       Ajout de l&#039;option <strong><code><a href="xml.constants.php#constant.xml-option-parse-huge">XML_OPTION_PARSE_HUGE</a></code></strong>.
      </td>
     </tr>

     <tr>
      <td>8.3.0</td>
      <td>
       Le paramètre <code class="parameter">value</code> accepte désormais également les booléens.
       Les options <strong><code><a href="xml.constants.php#constant.xml-option-case-folding">XML_OPTION_CASE_FOLDING</a></code></strong> et <strong><code><a href="xml.constants.php#constant.xml-option-skip-white">XML_OPTION_SKIP_WHITE</a></code></strong>
       sont désormais des options booléennes.
      </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>

     <tr>
      <td>8.0.0</td>
      <td>
       Une exception <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> est désormais lancée si
       l&#039;<code class="parameter">option</code> est invalide.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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