Package org.xmlunit.input
Class CommentLessSource
java.lang.Object
javax.xml.transform.dom.DOMSource
org.xmlunit.input.CommentLessSource
- All Implemented Interfaces:
Source
A source that is obtained from a different source by stripping all
comments.
As of XMLUnit 2.5.0 it is possible to select the XSLT version to use for the stylesheet. The default now is 2.0, it used to be 1.0 and you may need to change the value if your transformer doesn't support XSLT 2.0.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommentLessSource
(Source originalSource) Creates a new source that consists of the given source with all comments removed using an XSLT stylesheet of version 2.0.CommentLessSource
(Source originalSource, String xsltVersion) Creates a new source that consists of the given source with all comments removed. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Source
getStylesheet
(String xsltVersion) private static String
getStylesheetContent
(String xsltVersion) private static String
getStylesheetContentCached
(String xsltVersion) Methods inherited from class javax.xml.transform.dom.DOMSource
getNode, getSystemId, isEmpty, setNode, setSystemId
-
Field Details
-
DEFAULT_VERSION
- See Also:
-
STYLE_TEMPLATE
- See Also:
-
STYLE
Stylesheet used to strip all comments from an XML document.
-
-
Constructor Details
-
CommentLessSource
Creates a new source that consists of the given source with all comments removed using an XSLT stylesheet of version 2.0.- Parameters:
originalSource
- the original source
-
CommentLessSource
Creates a new source that consists of the given source with all comments removed.- Parameters:
originalSource
- the original sourcexsltVersion
- use this version for the stylesheet- Since:
- XMLUnit 2.5.0
-
-
Method Details
-
getStylesheet
-
getStylesheetContentCached
-
getStylesheetContent
-