|» Summary||» License|
|A framework for building XML filters using the SAX API||PHP|
|» Current Release||» Bug Summary|
0.3.0 (beta) was released on 2004-04-20 by hfuecks (Changelog)
Not sure? Get more info.
pear install XML_SaxFilters
No open bugs
Report a new bug to XML_SaxFilters
|XML_SaxFilters provides a foundation for using Sax filters in PHP.
The original code base was developed by Luis Argerich and published at
Luis discussed how SaxFilters work, using the Sourceforge classes as
an example, in Chapter 10 of Wrox &quot;PHP 4 XML&quot;.
Luis kindly gave permission to modify the code and license for
inclusion in PEAR.
This version of the Sax Filters makes significant changes to Luis's
original code (backwards compatibility is definately broken), seperating
abstract classes from interfaces, providing interfaces for data readers
and writers and providing methods to help parse XML documents recursively
with filters (for example AbstractFilter::setParent()) for documents where
the structure can vary significantly.
Sax Filtering is an approach to making parsing XML documents with Sax modular
and easy to maintain. The parser delegates events to a child filter which may
in turn delegate events to another filter. In general it's possible to implement
filters for a document which are as flexible and powerful as DOM.
For some discussions on Sax filtering try;
The API provided by XML_SaxFilters is a little different from that commonly
used in other languages, providing the concepts of &quot;parent&quot; and &quot;child&quot;.
A parent of the current filter is the filter (or parser) &quot;upsteam&quot; which
receive XML event notifications before the current filter.
A &quot;child&quot; is a filter &quot;downstream&quot; of the current filter (or parser) to
which XML events are delegated.
The top of the &quot;family tree&quot; of filters is always the parser itself, which
can have children but cannot have parents. Filters can have parents and
The parsers themselves never handle any XML events personally but always
delegate to a filter.
The parser accepts an object implementing the reader interface from which
it streams the XML.
The filters can be given an object implementing the writer interface
to write output to.
For an example of SAX filters in action with PHP try;
(example uses Luis Argerich original Sax Filters).
|» Maintainers||» More Information|