Package org.xmlunit.input
Class WhitespaceStrippedSource
- java.lang.Object
-
- javax.xml.transform.dom.DOMSource
-
- org.xmlunit.input.WhitespaceStrippedSource
-
- All Implemented Interfaces:
javax.xml.transform.Source
public class WhitespaceStrippedSource extends javax.xml.transform.dom.DOMSource
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.
-
-
Constructor Summary
Constructors Constructor Description WhitespaceStrippedSource(javax.xml.transform.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(javax.xml.transform.Source originalSource, javax.xml.parsers.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.
-
-
-
Constructor Detail
-
WhitespaceStrippedSource
public WhitespaceStrippedSource(javax.xml.transform.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.- Parameters:
originalSource
- the original source
-
WhitespaceStrippedSource
public WhitespaceStrippedSource(javax.xml.transform.Source originalSource, javax.xml.parsers.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.- Parameters:
originalSource
- the original sourcedbf
- the DocumentBuilderFactory to use when creating a DOM document from originalSource
-
-