Package org.xmlunit.input
Class WhitespaceStrippedSource
java.lang.Object
javax.xml.transform.dom.DOMSource
org.xmlunit.input.WhitespaceStrippedSource
- All Implemented Interfaces:
Source
A source that is obtained from a different source by removing all
empty text nodes and trimming the non-empty ones.
If you only want to remove text nodes consisting solely of
whitespace (AKA element content whitespace) but leave all other
text nodes alone you should use ElementContentWhitespaceStrippedSource
instead.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWhitespaceStrippedSource
(Source originalSource) Creates a new source that consists of the given source with all empty text nodes removed and all non-empty text nodes trimmed.WhitespaceStrippedSource
(Source originalSource, DocumentBuilderFactory dbf) Creates a new source that consists of the given source with all empty text nodes removed and all non-empty text nodes trimmed. -
Method Summary
Methods inherited from class javax.xml.transform.dom.DOMSource
getNode, getSystemId, isEmpty, setNode, setSystemId
-
Constructor Details
-
WhitespaceStrippedSource
Creates a new source that consists of the given source with all empty text nodes removed and all non-empty text nodes trimmed.- Parameters:
originalSource
- the original source
-
WhitespaceStrippedSource
Creates a new source that consists of the given source with all empty text nodes removed and all non-empty text nodes trimmed.- Parameters:
originalSource
- the original sourcedbf
- the DocumentBuilderFactory to use when creating a DOM document from originalSource
-