org.dsmltools.util
Class WhitespaceFilter

java.lang.Object
  extended by org.dsmltools.util.WhitespaceFilter
All Implemented Interfaces:
org.w3c.dom.traversal.NodeFilter

public class WhitespaceFilter
extends java.lang.Object
implements org.w3c.dom.traversal.NodeFilter

This class is an implementation of the NodeFilter interface which passes only text nodes that contain only whitespace. We use it on all DSML documents we read in, as part of the workaround for the problem that the parser won't remove them automatically for us.


Field Summary
 
Fields inherited from interface org.w3c.dom.traversal.NodeFilter
FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP, SHOW_ALL, SHOW_ATTRIBUTE, SHOW_CDATA_SECTION, SHOW_COMMENT, SHOW_DOCUMENT, SHOW_DOCUMENT_FRAGMENT, SHOW_DOCUMENT_TYPE, SHOW_ELEMENT, SHOW_ENTITY, SHOW_ENTITY_REFERENCE, SHOW_NOTATION, SHOW_PROCESSING_INSTRUCTION, SHOW_TEXT
 
Constructor Summary
WhitespaceFilter()
           
 
Method Summary
 short acceptNode(org.w3c.dom.Node xiNode)
          This method determines whether a node is a whitespace text node or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhitespaceFilter

public WhitespaceFilter()
Method Detail

acceptNode

public short acceptNode(org.w3c.dom.Node xiNode)
This method determines whether a node is a whitespace text node or not.

Specified by:
acceptNode in interface org.w3c.dom.traversal.NodeFilter
Parameters:
xiNode - The node to check
Returns:
Either FILTER_REJECT or FILTER_ACCEPT, depending on whether