<?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 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.xml-parser-create-ns.php',
    1 => 'xml_parser_create_ns',
    2 => '创建支持命名空间的 XML 解析器',
  ),
  'up' => 
  array (
    0 => 'ref.xml.php',
    1 => 'XML 解析器函数',
  ),
  'prev' => 
  array (
    0 => 'function.xml-parser-create.php',
    1 => 'xml_parser_create',
  ),
  'next' => 
  array (
    0 => 'function.xml-parser-free.php',
    1 => 'xml_parser_free',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/xml/functions/xml-parser-create-ns.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.xml-parser-create-ns" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xml_parser_create_ns</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">xml_parser_create_ns</span> &mdash; <span class="dc-title">创建支持命名空间的 XML 解析器</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.xml-parser-create-ns-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>xml_parser_create_ns</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$separator</code><span class="initializer"> = &quot;:&quot;</span></span>): <span class="type"><a href="class.xmlparser.php" class="type XMLParser">XMLParser</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>xml_parser_create_ns()</strong></span> 新建支持 XML 命名空间的解析器并返回可被其它 XML 函数使用的 <span class="classname"><a href="class.xmlparser.php" class="classname">XMLParser</a></span> 实例。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xml-parser-create-ns-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       自动检测输入编码，因此 <code class="parameter">encoding</code> 参数仅指定输出编码。默认输出字符集是 UTF-8。支持的编码有
       <code class="literal">ISO-8859-1</code>、<code class="literal">UTF-8</code> 和 <code class="literal">US-ASCII</code>。
      </p>
     </dd>
    
    
     <dt><code class="parameter">separator</code></dt>
     <dd>
      <p class="para">
       使用名称空间感知的解析器标记参数传递给各种处理函数将由名称空间和标记名称组成，这些名称由 <code class="parameter">separator</code> 中指定的字符串分隔。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xml-parser-create-ns-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回新 <span class="classname"><a href="class.xmlparser.php" class="classname">XMLParser</a></span> 实例。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.xml-parser-create-ns-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       此函数现在返回 <span class="classname"><a href="class.xmlparser.php" class="classname">XMLParser</a></span> 实例；之前返回 <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">encoding</code> 现在可以为 null。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.xml-parser-create-ns-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.xml-parser-create.php" class="function" rel="rdfs-seeAlso">xml_parser_create()</a> - 创建 XML 解析器</span></li>
   </ul>
  </p>
 </div>


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