<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.xml-parser-set-option.php',
    1 => 'xml_parser_set_option',
    2 => 'Set options in an XML parser',
  ),
  'up' => 
  array (
    0 => 'ref.xml.php',
    1 => 'XML Parser Funktionen',
  ),
  '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' => 'en',
    '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">Set options in an XML parser</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xml-parser-set-option-description">
  <h3 class="title">Beschreibung</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">
   Sets an option in an XML parser.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xml-parser-set-option-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">parser</code></dt>
     <dd>
      <p class="para">
       A reference to the XML parser to set an option in.
      </p>
     </dd>
    
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       Which option to set.  See below.
      </p>
      <p class="para">
       The following options are available:
       <table class="doctable table">
        <caption><strong>XML parser options</strong></caption>
        
         <thead>
          <tr>
           <th>Option constant</th>
           <th>Data type</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>
            Controls whether <a href="xml.case-folding.php" class="link">case-folding</a> is enabled for this
            XML parser.  Enabled by default.
           </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>
            Allows parsing documents larger than 10 MB.
            This option should only be enabled when the document size is
            bounded because this could otherwise lead to a DoS.
            This option is only available when using 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>
            Specify how many characters should be skipped in the beginning of a
            tag name.
           </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>bool</td>
           <td>
            Whether to skip values consisting of whitespace characters.
           </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>
            Sets which <a href="xml.encoding.php" class="link">target encoding</a> to
            use in this XML parser.By default, it is set to the same as the
            source encoding used by <span class="function"><a href="function.xml-parser-create.php" class="function">xml_parser_create()</a></span>.
            Supported target encodings are <code class="literal">ISO-8859-1</code>,
            <code class="literal">US-ASCII</code> and <code class="literal">UTF-8</code>.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       The option&#039;s new value.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xml-parser-set-option-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.xml-parser-set-option-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="para">
   Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> when an invalid value is passed
   to <code class="parameter">option</code>.
  </p>
  <p class="para">
   Prior to PHP 8.0.0, the function returned false when passing an invalid
   value to
   <code class="parameter">option</code> generated a <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
   as well as making the function return <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">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Added the 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>
       The <code class="parameter">value</code> parameter now also accepts booleans.
       The options <strong><code><a href="xml.constants.php#constant.xml-option-case-folding">XML_OPTION_CASE_FOLDING</a></code></strong> and <strong><code><a href="xml.constants.php#constant.xml-option-skip-white">XML_OPTION_SKIP_WHITE</a></code></strong>
       are now boolean options.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">parser</code> erwartet nun eine
  <span class="classname"><a href="class.xmlparser.php" class="classname">XMLParser</a></span>-Instanz; vorher wurde eine gültige
  <code class="literal">xml</code>-<span class="type">Ressource</span> erwartet.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       A <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is now thrown if
       <code class="parameter">option</code> is invalid.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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