Source of: /manual/en/function.xml-set-unparsed-entity-decl-handler.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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 => 'en',
),
'this' =>
array (
0 => 'function.xml-set-unparsed-entity-decl-handler.php',
1 => 'xml_set_unparsed_entity_decl_handler',
),
'up' =>
array (
0 => 'ref.xml.php',
1 => 'XML Parser Functions',
),
'prev' =>
array (
0 => 'function.xml-set-start-namespace-decl-handler.php',
1 => 'xml_set_start_namespace_decl_handler',
),
'next' =>
array (
0 => 'book.xmlreader.php',
1 => 'XMLReader',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.xml-set-unparsed-entity-decl-handler" class="refentry">
<div class="refnamediv">
<h1 class="refname">xml_set_unparsed_entity_decl_handler</h1>
<p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">xml_set_unparsed_entity_decl_handler</span> — <span class="dc-title">
Set up unparsed entity declaration handler
</span></p>
</div>
<a name="function.xml-set-unparsed-entity-decl-handler.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><b>xml_set_unparsed_entity_decl_handler</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$parser</tt></span>
, <span class="methodparam"><span class="type"><a href="language.pseudo-types.php#language.types.callback" class="type callback">callback</a></span> <tt class="parameter">$handler</tt></span>
)</div>
<p class="para rdfs-comment">
Sets the unparsed entity declaration handler function for the XML parser
<i><tt class="parameter">parser</tt></i>
.
</p>
<p class="para">
The <i><tt class="parameter">handler</tt></i>
will be called if the XML parser
encounters an external entity declaration with an NDATA declaration, like
the following:
</p><div class="example-contents programlisting">
<div class="xmlcode"><pre class="xmlcode"><!ENTITY <parameter>name</parameter> {<parameter>publicId</parameter> | <parameter>systemId</parameter>}
NDATA <parameter>notationName</parameter></pre>
</div>
</div>
<p>
</p>
<p class="para">
See <a href="http://www.w3.org/TR/1998/REC-xml-19980210#sec-external-ent" class="link external">» section 4.2.2 of
the XML 1.0 spec</a> for the definition of notation declared
external entities.
</p>
</div>
<a name="function.xml-set-unparsed-entity-decl-handler.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">parser</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">handler</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
<i><tt class="parameter">handler</tt></i>
is a string containing the name of a
function that must exist when <a href="function.xml-parse.php" class="function">xml_parse()</a> is called
for <i><tt class="parameter">parser</tt></i>
.
</p>
<p class="para">
The function named by <i><tt class="parameter">handler</tt></i>
must accept six
parameters:
<div class="methodsynopsis dc-description">
<span class="methodname"><span class="replaceable">handler</span></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$parser</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$entity_name</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$base</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$system_id</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$public_id</tt></span>
, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$notation_name</tt></span>
)</div>
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">parser</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
The first parameter, <span class="replaceable">parser</span>, is a
reference to the XML parser calling the
handler.
</span>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">entity_name</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
The name of the entity that is about to be defined.
</span>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">base</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
This is the base for resolving the system identifier
(<i><tt class="parameter">systemId</tt></i>
) of the external entity.Currently
this parameter will always be set to an empty string.
</span>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">system_id</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
System identifier for the external entity.
</span>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">public_id</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
Public identifier for the external entity.
</span>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">notation_name</tt></i>
</span>
</dt><dd class="listitem">
<span class="simpara">
Name of the notation of this entity (see
<a href="function.xml-set-notation-decl-handler.php" class="function">xml_set_notation_decl_handler()</a>).
</span>
</dd>
</dl>
<p>
</p>
<p class="para">
If a handler function is set to an empty string, or <b><tt class="constant">FALSE</tt></b>, the handler
in question is disabled.
</p>
<blockquote><p><b class="note">Note</b>: <span class="simpara">Instead of a function name, an
array containing an object reference and a method name can also be
supplied.</span></p></blockquote>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.xml-set-unparsed-entity-decl-handler.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
</div><?php manual_footer(); ?>