Package org.xmlunit.input
Class NormalizedSource
java.lang.Object
javax.xml.transform.dom.DOMSource
org.xmlunit.input.NormalizedSource
- All Implemented Interfaces:
Source
Performs XML normalization on a given Source, Document or Node.
For Nodes this means adjacent text nodes are merged to single nodes and empty Text nodes removed (recursively). For Documents and Sources additional normalization steps may be taken depending on your DOMConfiguration. See the linked JavaDocs for details.
When reading documents a parser usually puts the document into normalized form anway. You will only need to perform XML normalization on DOM trees you have created programmatically.
- See Also:
-
- "http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#normalizeDocument%28%29"
- "http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Node.html#normalize%28%29"
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAn empty source.NormalizedSource
(Source originalSource) Creates a new source that is created by "normalizing" the given source.NormalizedSource
(Document doc) Creates a new source that is created by "normalizing" the given document.NormalizedSource
(Document doc, String systemId) Creates a new source that is created by "normalizing" the given document.Creates a new source that is created by "normalizing" the given node.NormalizedSource
(Node n, String systemId) Creates a new source that is created by "normalizing" the given node. -
Method Summary
Methods inherited from class javax.xml.transform.dom.DOMSource
getNode, getSystemId, isEmpty, setSystemId
-
Constructor Details
-
NormalizedSource
public NormalizedSource()An empty source. -
NormalizedSource
Creates a new source that is created by "normalizing" the given source.See the class-level JavaDocs for details.
- Parameters:
originalSource
- the original source
-
NormalizedSource
Creates a new source that is created by "normalizing" the given document.See the class-level JavaDocs for details.
- Parameters:
doc
- the original source
-
NormalizedSource
Creates a new source that is created by "normalizing" the given document.See the class-level JavaDocs for details.
- Parameters:
doc
- the original sourcesystemId
- the system id to use for the new source
-
NormalizedSource
Creates a new source that is created by "normalizing" the given node.See the class-level JavaDocs for details.
- Parameters:
n
- the original node
-
NormalizedSource
Creates a new source that is created by "normalizing" the given node.See the class-level JavaDocs for details.
- Parameters:
n
- the original nodesystemId
- the system id to use for the new source
-
-
Method Details