com.simonstl.ool
Class OolCleanSAXFilter

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--com.simonstl.ool.OolCleanSAXFilter
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 OolCleanSAXFilter
extends org.xml.sax.helpers.XMLFilterImpl

This class removes single ool:text elements and puts their attributes into their parent element.

Warning: This class is still very much under construction and is broken for most cases.

Warning: this processor does not preserve the relative ordering of processing instructions intermingled with text.

Version:
0.01 $Date: 2002/05/06 $
Author:
Simon St.Laurent

Field Summary
protected  java.lang.StringBuffer chars
           
protected  org.xml.sax.helpers.AttributesImpl emptyAtts
           
protected  boolean previousEndEvent
           
protected  StartStack stack
           
 
Constructor Summary
OolCleanSAXFilter(org.xml.sax.XMLReader parent)
          A constructor that takes the parser which will feed it SAX events
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Handles endElement events.
static void main(java.lang.String[] args)
          FilterTester's main method requires one argument - a target XML file.
static void printHelp()
           
protected  void reportEndElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
protected  void reportEndStack()
           
protected  void reportMeshedStack()
           
protected  void reportStack()
           
protected  void reportStartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Handles startElement events.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousEndEvent

protected boolean previousEndEvent

stack

protected StartStack stack

chars

protected java.lang.StringBuffer chars

emptyAtts

protected org.xml.sax.helpers.AttributesImpl emptyAtts
Constructor Detail

OolCleanSAXFilter

public OolCleanSAXFilter(org.xml.sax.XMLReader parent)
A constructor that takes the parser which will feed it SAX events
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Handles startElement events.
Overrides:
startElement in class org.xml.sax.helpers.XMLFilterImpl

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Handles endElement events.
Overrides:
endElement in class org.xml.sax.helpers.XMLFilterImpl

reportStack

protected void reportStack()
                    throws org.xml.sax.SAXException

reportEndStack

protected void reportEndStack()
                       throws org.xml.sax.SAXException

reportMeshedStack

protected void reportMeshedStack()
                          throws org.xml.sax.SAXException

reportStartElement

protected void reportStartElement(java.lang.String uri,
                                  java.lang.String localName,
                                  java.lang.String qName,
                                  org.xml.sax.Attributes atts)
                           throws org.xml.sax.SAXException

reportEndElement

protected void reportEndElement(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.String qName)
                         throws org.xml.sax.SAXException

printHelp

public static void printHelp()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
FilterTester's main method requires one argument - a target XML file. Options may appear before those arguments:
-p [parser class name] - use the parser specified