net.sf.saxon
Class IDFilter

java.lang.Object
  extended byorg.xml.sax.helpers.XMLFilterImpl
      extended bynet.sf.saxon.IDFilter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class IDFilter
extends org.xml.sax.helpers.XMLFilterImpl

IDFilter is a SAX filter that extracts the subtree of a document rooted at the element with a given ID value. Namespace declarations outside this subtree are treated as if they were present on the identified element.


Constructor Summary
IDFilter(java.lang.String id)
           
 
Method Summary
 void characters(char[] chars, int start, int len)
          Filter a character data event.
 void endElement(java.lang.String localName, java.lang.String uri, java.lang.String qname)
          Filter an end element event.
 void endPrefixMapping(java.lang.String prefix)
          Filter an end Namespace prefix mapping event.
 void ignorableWhitespace(char[] chars, int start, int len)
          Filter an ignorable whitespace event.
 void processingInstruction(java.lang.String name, java.lang.String data)
          Filter a processing instruction event.
 void startElement(java.lang.String localName, java.lang.String uri, java.lang.String qname, org.xml.sax.Attributes atts)
          Filter a start element event.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Filter a start Namespace prefix mapping event.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, parse, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDFilter

public IDFilter(java.lang.String id)
Method Detail

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter a start Namespace prefix mapping event.

Parameters:
prefix - The Namespace prefix.
uri - The Namespace URI.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter an end Namespace prefix mapping event.

Parameters:
prefix - The Namespace prefix.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.endPrefixMapping(java.lang.String)

startElement

public void startElement(java.lang.String localName,
                         java.lang.String uri,
                         java.lang.String qname,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter a start element event.

Parameters:
localName - The element's Namespace URI, or the empty string.
uri - The element's local name, or the empty string.
qname - The element's qualified (prefixed) name, or the empty string.
atts - The element's attributes.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String localName,
                       java.lang.String uri,
                       java.lang.String qname)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter an end element event.

Parameters:
localName - The element's Namespace URI, or the empty string.
uri - The element's local name, or the empty string.
qname - The element's qualified (prefixed) name, or the empty string.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] chars,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter a character data event.

Parameters:
chars - An array of characters.
start - The starting position in the array.
len - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int len)
                         throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter an ignorable whitespace event.

Parameters:
chars - An array of characters.
start - The starting position in the array.
len - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String name,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Description copied from class: org.xml.sax.helpers.XMLFilterImpl
Filter a processing instruction event.

Parameters:
name - The processing instruction target.
data - The text following the target.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)