libxml-perl
view release on metacpan or search on metacpan
doc/sax-2.0-adv.html view on Meta::CPAN
<td>The declared public identifier for the external DTD subset, or
<tt>undef</tt> if none was declared.</td></tr>
<tr><td><b><tt>SystemId</tt></b></td>
<td>The declared system identifier for the external DTD subset, or
<tt>undef</tt> if none was declared.</td></tr>
</table>
</blockquote></dd>
</dl></p>
<p>
<dl><dt><b><tt class='function'>end_dtd</tt></b>(<var>dtd</var>)</dt>
<dd>
Report the end of DTD declarations.
<p>No properties are defined for this event (<var>dtd</var> is
empty).</p></dd></dl></p>
<p>
<dl><dt><b><tt class='function'>start_entity</tt></b>(<var>entity</var>)</dt>
<dd>
Report the beginning of an entity in content.
<p><b>NOTE</b>: entity references in attribute values -- and the start
and end of the document entity -- are never reported.</p>
<p>The start and end of the external DTD subset are reported using the
pseudo-name "[dtd]". All other events must be properly nested within
start/end entity events.</p>
<p>Note that skipped entities will be reported through the
<tt>skipped_entity()</tt> event, which is part of the ContentHandler
interface.</p>
<p><var>entity</var> is a hash with these properties:</p>
<blockquote>
<table>
<tr><td><b><tt>Name</tt></b></td>
<td>The name of the entity. If it is a parameter entity, the
name will begin with '%'.</td></tr>
</table>
</blockquote></dd>
</dl></p>
<p>
<dl><dt><b><tt class='function'>end_entity</tt></b>(<var>entity</var>)</dt>
<dd>
Report the end of an entity.
<p><var>entity</var> is a hash with these properties:</p>
<blockquote>
<table>
<tr><td><b><tt>Name</tt></b></td>
<td>The name of the entity that is ending.</td></tr>
</table>
</blockquote></dd>
</dl></p>
<p>
<dl><dt><b><tt class='function'>start_cdata</tt></b>(<var>cdata</var>)</dt>
<dd>
Report the start of a CDATA section.
<p>The contents of the CDATA section will be reported through the
regular characters event.</p>
<p>No properties are defined for this event (<var>cdata</var> is
empty).</p></dd></dl></p>
<p>
<dl><dt><b><tt class='function'>end_cdata</tt></b>(<var>cdata</var>)</dt>
<dd>
Report the end of a CDATA section.
<p>No properties are defined for this event (<var>cdata</var> is
empty).</p></dd></dl></p>
<p>
<dl><dt><b><tt class='function'>comment</tt></b>(<var>comment</var>)</dt>
<dd>
Report an XML comment anywhere in the document.
<p>This callback will be used for comments inside or outside the
document element, including comments in the external DTD subset (if
read).</p>
<p><var>comment</var> is a hash with these properties:</p>
<blockquote>
<table>
<tr><td><b><tt>Data</tt></b></td>
<td>The comment characters.</td></tr>
</table>
</blockquote></dd>
</dl></p>
<h2><a name="Filters">SAX Filters</a></h2>
<p>An XML filter is like an XML event generator, except that it
obtains its events from another XML event generator rather than a
primary source like an XML document or database. Filters can modify a
stream of events as they pass on to the final application.</p>
<p>
<dl><dt><b><tt>Parent</tt></b></dt>
<dd>
The parent reader.
<p>This Feature allows the application to link the filter to a parent
event generator (which may be another filter).</p></dd></dl></p>
<p>
See the XML::SAX::Base module for more on filters. It is meant to be
used as a base class for filters and drivers, and makes them much
easier to implement.
</p>
<h2><a name="Java">Java Compatibility</a></h2>
The Perl SAX 2.0 binding differs from the Java binding in these ways:
<ul>
<li>Takes parameters to <tt>new()</tt>, to <tt>parse()</tt>, and to be
set directly in the object, instead of requiring set/get calls (see
below).</li>
<li>Allows a default <tt>Handler</tt> parameter to be used for all
handlers.</li>
<li>
No base classes are enforced. Instead, parsers dynamically
check the handlers for what methods they support. Note however that
using XML::SAX::Base as your base class for Drivers and Filters will
make your code a lot simpler, less error prone, and probably much more
( run in 0.566 second using v1.01-cache-2.11-cpan-140bd7fdf52 )