Class RulesLoader

All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class RulesLoader
extends org.xml.sax.helpers.DefaultHandler

This class loads the information stored in a rules document for use in fragment filtering. It's based on Ethan Cerami's Xerces Quickstart, available at:

Version 0.12 gives the factories even more control over object creation.

Version 0.11 delegates most object creation to factories.

Version 0.10 changed split="true|false" to type="match|split|series".

Version 0.09 adds support for attributes in target elements.

Version 0.08 adds support for attributes in result elements.

Version 0.07 supports the move to DocComponent from Element. Note the use of the Characters and Skip classes. Also note that this move is currently partial - no support yet for non-Element targets.

Version 0.06 added support for the beforeInside and afterInside attributes of the resultElement element.

Version 0.05 added support for the chars element and the before and after attributes, and modified how support for the skip element worked. Elements with empty nsURI and localName attributes are now treated as chars elements, not skip elements.

Version 0.04 added support for the pattern attribute, replacing matchPattern, and added support for the split attribute of the fragmentRule element.

Version 0.03 added support for the skipFirst and repeat attributes of the fragmentRule element.

Version 0.02 added support for the skip element, which permits rules to skip portions of a match. (By default the first match is skipped.)

0.11 13 July 2001
Simon St.Laurent

Field Summary
protected static java.util.ArrayList appliesTo
 FragmentRules rules
Constructor Summary
RulesLoader(java.lang.String xmlFile, org.xml.sax.XMLReader parser)
Method Summary
 void endElement(java.lang.String uri, java.lang.String local, java.lang.String qName)
 void startElement(java.lang.String uri, java.lang.String local, java.lang.String qName, org.xml.sax.Attributes atts)
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, 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


public FragmentRules rules


protected static java.util.ArrayList appliesTo
Constructor Detail


public RulesLoader(java.lang.String xmlFile,
                   org.xml.sax.XMLReader parser)
Method Detail


public void startElement(java.lang.String uri,
                         java.lang.String local,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
startElement in class org.xml.sax.helpers.DefaultHandler


public void endElement(java.lang.String uri,
                       java.lang.String local,
                       java.lang.String qName)
endElement in class org.xml.sax.helpers.DefaultHandler