public final class CommentLessSource
extends javax.xml.transform.dom.DOMSource
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.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_VERSION |
static java.lang.String |
STYLE
Stylesheet used to strip all comments from an XML document.
|
private static java.lang.String |
STYLE_TEMPLATE |
Constructor and Description |
---|
CommentLessSource(javax.xml.transform.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(javax.xml.transform.Source originalSource,
java.lang.String xsltVersion)
Creates a new source that consists of the given source with all
comments removed.
|
Modifier and Type | Method and Description |
---|---|
private static javax.xml.transform.Source |
getStylesheet(java.lang.String xsltVersion) |
private static java.lang.String |
getStylesheetContent(java.lang.String xsltVersion) |
private static java.lang.String |
getStylesheetContentCached(java.lang.String xsltVersion) |
private static final java.lang.String DEFAULT_VERSION
private static final java.lang.String STYLE_TEMPLATE
public static final java.lang.String STYLE
public CommentLessSource(javax.xml.transform.Source originalSource)
originalSource
- the original sourcepublic CommentLessSource(javax.xml.transform.Source originalSource, java.lang.String xsltVersion)
originalSource
- the original sourcexsltVersion
- use this version for the stylesheetprivate static javax.xml.transform.Source getStylesheet(java.lang.String xsltVersion)
private static java.lang.String getStylesheetContentCached(java.lang.String xsltVersion)
private static java.lang.String getStylesheetContent(java.lang.String xsltVersion)