Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
140
The org.xml.sax.XMLFilter Interface
Sub Interfaces: org.xml.sax.XMLReader
Implementing classes: org.xml.sax.helpers.XMLFilterImpl
Members
Signature
Public methods
XMLReader
getParent()
void
setParent(XMLReader parent)
Overview
An XML filter is like an XML reader,
except that it obtains its events from another XML reader 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. By allowing a hierarchy of XMLreader
through this filtering mechanism, you can build up a processing chain, or a
pipeline, of events. To understand what is indicated here is the normal flow of
a SAX parse:
·
Events in an
XML document are passed to a SAX reader.
·
The SAX
reader and registered handlers pass events and data to an application.
Method Overviews
This class extends the XMLReader
interface, and adds two new methods to that class as mentioned above. By
allowing such filtering is that it is simple to insert one or more additional
links into this chain:
·
Events in an XML document are passed to a SAX reader.
·
The SAX reader performs some processing and passes information to another
SAX reader.
·
Repeat until all SAX processing is done.
·
Finally, the SAX reader and registered handlers pass events and data to
an application.
It is
the middle steps that introduce a pipeline, where one reader that performed
specific processing passes its information on to another reader, repeatedly,
instead of having to lump all code into one reader. When this pipeline is set
up with multiple readers, modular and efficient programming results. And that’s
what the XML filter class allows: chaining of XMLReader implementations through
filtering. Enhancing this event further is the class
org.xml.sax.helpers.XMLFilterImpl, which provides a helpful implementation of
XMLFiletr and the DeafultHandler class.
Please refer
NamespaceFilter.java in attached source code for more details