mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
165 lines
5.6 KiB
HTML
165 lines
5.6 KiB
HTML
<!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>建立注释声明处理器</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.xml-set-notation-decl-handler" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">xml_set_notation_decl_handler</h1>
|
||
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">xml_set_notation_decl_handler</span> — <span class="dc-title">建立注释声明处理器</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 description" id="refsect1-function.xml-set-notation-decl-handler-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>xml_set_notation_decl_handler</strong></span>
|
||
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$parser</code></span>
|
||
, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$handler</code></span>
|
||
) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
为 <code class="parameter">parser</code> 参数指定的 XML 解析器建立注释声明处理器函数。
|
||
</p>
|
||
<p class="para">
|
||
注释声明是文档 DTD 的一部分,并有如下格式:
|
||
<div class="example-contents">
|
||
<div class="xmlcode"><pre class="xmlcode"><!NOTATION <parameter>name</parameter>
|
||
{<parameter>system_id</parameter> | <parameter>public_id</parameter>}?></pre>
|
||
</div>
|
||
</div>
|
||
。请参考 <a href="http://www.w3.org/TR/1998/REC-xml-19980210#Notations" class="link external">» XML 1.0 参考的第 4.7 节</a>以了解注释声明的定义。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.xml-set-notation-decl-handler-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">parser</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
XML 解析器的引用,用于设置声明处理器函数。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">handler</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">handler</code> 为表示函数名称的字符串,函数必须在为 <code class="parameter">parser</code> 指定的解析器调用 <span class="function"><a href="xml_parse.html" class="function">xml_parse()</a></span> 函数时已存在。
|
||
</p>
|
||
<p class="para">
|
||
由 <code class="parameter">handler</code> 参数命名的函数名必须接受五个参数:
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><span class="replaceable">handler</span></span>
|
||
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$parser</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$notation_name</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$base</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$system_id</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$public_id</code></span>
|
||
)</div>
|
||
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
|
||
<code class="parameter">parser</code>
|
||
</dt>
|
||
|
||
<dd>
|
||
|
||
<span class="simpara">
|
||
第一个参数 <span class="replaceable">parser</span> 为指向要调用处理器的 XML 解析器的指针。
|
||
</span>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">notation_name</code></dt>
|
||
|
||
<dd>
|
||
|
||
<span class="simpara">
|
||
该参数为以上注释格式定义中的 <code class="parameter">name</code> 参数。
|
||
</span>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
|
||
<code class="parameter">base</code>
|
||
</dt>
|
||
|
||
<dd>
|
||
|
||
<span class="simpara">
|
||
这个参数是解析注释声明的系统标识符(<code class="parameter">system_id</code>)的基础。当前该参数通常都被设置为空字符串。
|
||
</span>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">system_id</code></dt>
|
||
|
||
<dd>
|
||
|
||
<span class="simpara">
|
||
外部注释声明的系统标识符。
|
||
</span>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
|
||
<code class="parameter">public_id</code>
|
||
</dt>
|
||
|
||
<dd>
|
||
|
||
<span class="simpara">
|
||
外部注释声明的公共标识符。
|
||
</span>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
<p class="para">
|
||
如果处理器函数名被设置为空字符串或者 <strong><code>FALSE</code></strong>,则该有问题的处理器将被屏蔽。
|
||
</p>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">除了函数名,含有对象引用的数组和方法名也可以作为参数。</span></p></blockquote>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.xml-set-notation-decl-handler-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |