uTools-Manuals/docs/php/xml_parser_set_option.html
2019-04-08 23:22:26 +08:00

122 lines
4.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>为指定 XML 解析进行选项设置</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><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)</p><p class="refpurpose"><span class="refname">xml_parser_set_option</span> &mdash; <span class="dc-title">为指定 XML 解析进行选项设置</span></p>
</div>
<div class="refsect1 unknown-unknown-unknown-unknown-unknown-returnvaluex" id="refsect1-function.xml-parser-set-option-unknown-unknown-unknown-unknown-unknown-returnvaluex">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>xml_parser_set_option</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$parser</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$option</code></span>
, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
<dl>
<dt>
<code class="parameter">parser</code></dt>
<dd>
<span class="simpara">
指向要设置选项信息的 XML 解析器的指针。
</span>
</dd>
<dt>
<code class="parameter">option</code></dt>
<dd>
<span class="simpara">
要设置的选项名称。请参考下文。
</span>
</dd>
<dt>
<code class="parameter">value</code></dt>
<dd>
<span class="simpara">
要给选项设置的新值。
</span>
</dd>
</dl>
</p>
<p class="para">
如果 <code class="parameter">parser</code> 参数没有指向一个合法的解析器或者指定的选项无法设置,该函数将返回 <strong><code>FALSE</code></strong>,否则将会把选项设置为指定的值并返回 <strong><code>TRUE</code></strong>
</p>
<p class="para">
可被设置的选项如下:
<table class="doctable table">
<caption><strong>XML 解析器选项</strong></caption>
<thead>
<tr>
<th>选项常量</th>
<th>数据类型</th>
<th>描述</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>XML_OPTION_CASE_FOLDING</td>
<td>integer</td>
<td>
控制在该 XML 解析器中 <a href="xml.case_folding.html" class="link">大小写折叠case-folding</a> 是否有效。其默认值为有效。
</td>
</tr>
<tr>
<td>XML_OPTION_SKIP_TAGSTART</td>
<td>integer</td>
<td>
指明在一个标记名前应略过几个字符。
</td>
</tr>
<tr>
<td>XML_OPTION_SKIP_WHITE</td>
<td>integer</td>
<td>
是否略过由白空字符组成的值。
</td>
</tr>
<tr>
<td>XML_OPTION_TARGET_ENCODING</td>
<td>string</td>
<td>
设置该 XML 解析器所使用的<a href="xml.encoding.html" class="link">目标编码target encoding</a>方式。其默认值和由 <span class="function"><a href="xml_parser_create.html" class="function">xml_parser_create()</a></span> 函数设置的源编码source encoding方式相同。支持的目标编码方式有 <em>ISO-8859-1</em><em>US-ASCII</em><em>UTF-8</em>
</td>
</tr>
</tbody>
</table>
</p>
</div>
</div></div></div></body></html>