Package org.xmlunit.input
Class WhitespaceNormalizedSource
java.lang.Object
javax.xml.transform.dom.DOMSource
org.xmlunit.input.WhitespaceNormalizedSource
- All Implemented Interfaces:
Source
A source that is obtained from a different source by removing all
empty text nodes and normalizing the non-empty ones.
"normalized" in this context means all whitespace characters are replaced by space characters and consecutive whitespace characters are collapsed.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWhitespaceNormalizedSource
(Source originalSource) Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.WhitespaceNormalizedSource
(Source originalSource, DocumentBuilderFactory dbf) Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed. -
Method Summary
Methods inherited from class javax.xml.transform.dom.DOMSource
getNode, getSystemId, isEmpty, setNode, setSystemId
-
Constructor Details
-
WhitespaceNormalizedSource
Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.- Parameters:
originalSource
- the original source
-
WhitespaceNormalizedSource
Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.- Parameters:
originalSource
- the original sourcedbf
- the DocumentBuilderFactory to use when creating a DOM document from originalSource
-