Save This Page
Home » Xerces-J-src.2.9.1 » sax » [javadoc | source]
sax
public class: DataUnformatFilter [javadoc | source]
java.lang.Object
   org.xml.sax.helpers.XMLFilterImpl
      sax.XMLFilterBase
         sax.DataUnformatFilter

All Implemented Interfaces:
    LexicalHandler, ErrorHandler, EntityResolver, XMLFilter, ContentHandler, DTDHandler

Filter for removing formatting from data- or field-oriented XML. Code and comments adapted from DataWriter-0.2, written by David Megginson and released into the public domain, without warranty.

This filter removes leading and trailing whitespace from field-oriented XML without mixed content. Note that this class will likely not yield appropriate results for document-oriented XML like XHTML pages, which mix character data and elements together.

Fields inherited from sax.XMLFilterBase:
EMPTY_ATTS,  LEXICAL_HANDLER_NAMES
Constructor:
 public DataUnformatFilter() 
 public DataUnformatFilter(XMLReader xmlreader) 
    Create a new filter.

    Use the XMLReader provided as the source of events.

    Parameters:
    xmlreader - The parent in the filter chain.
Method from sax.DataUnformatFilter Summary:
characters,   clearWhitespace,   emitWhitespace,   endElement,   ignorableWhitespace,   processingInstruction,   reset,   saveWhitespace,   startDocument,   startElement
Methods from sax.XMLFilterBase:
characters,   comment,   dataElement,   dataElement,   dataElement,   dataElement,   emptyElement,   emptyElement,   emptyElement,   emptyElement,   endCDATA,   endDTD,   endElement,   endElement,   endEntity,   getLexicalHandler,   getProperty,   parse,   setLexicalHandler,   setProperty,   startCDATA,   startDTD,   startElement,   startElement,   startElement,   startEntity
Methods from org.xml.sax.helpers.XMLFilterImpl:
characters,   endDocument,   endElement,   endPrefixMapping,   error,   fatalError,   getContentHandler,   getDTDHandler,   getEntityResolver,   getErrorHandler,   getFeature,   getParent,   getProperty,   ignorableWhitespace,   notationDecl,   parse,   parse,   processingInstruction,   resolveEntity,   setContentHandler,   setDTDHandler,   setDocumentLocator,   setEntityResolver,   setErrorHandler,   setFeature,   setParent,   setProperty,   skippedEntity,   startDocument,   startElement,   startPrefixMapping,   unparsedEntityDecl,   warning
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sax.DataUnformatFilter Detail:
 public  void characters(char[] ch,
    int start,
    int length) throws SAXException 
    Filter a character data event.
 protected  void clearWhitespace() 
    Discards saved whitespace.
 protected  void emitWhitespace() throws SAXException 
    Passes saved whitespace down the filter chain.
 public  void endElement(String uri,
    String localName,
    String qName) throws SAXException 
    Filter an end element event.
 public  void ignorableWhitespace(char[] ch,
    int start,
    int length) throws SAXException 
    Filter an ignorable whitespace event.
 public  void processingInstruction(String target,
    String data) throws SAXException 
    Filter a processing instruction event.
 public  void reset() 
    Reset the filter so that it can be reused.

    This method is especially useful if the filter failed with an exception the last time through.

 protected  void saveWhitespace(char[] ch,
    int start,
    int length) 
    Saves trailing whitespace.
 public  void startDocument() throws SAXException 
    Filter a start document event.

    Reset state and pass the event on for further processing.

 public  void startElement(String uri,
    String localName,
    String qName,
    Attributes atts) throws SAXException 
    Filter a start element event.