These releases fix a few bugs and introduce smaller new features as
well as a completely new experimental module that aims to provide a
DSL that controls the diff process inside of the control XML document.
Starting with XMLUnit 2.6.0 all XML parsers are configured according
to OWASP recommendations for XML eXternal Entity injection
preventions
- which means you need to override certain settings if you need to
load external entities. This is a change that breaks backwards
compatibility - at least in the Java version. If you've been using
.NET 4.5.2 or above all configurations have been safe by default
anyway.
XXE prevention is not enabled inside of the validation package and
XMLUnit for Java's legacy module.
The full list of changes for XMLUnit for Java:
add a new experimental project xmlunit-placeholders which aims to
use ${xmlunit.FOO} expressions inside of the control document to
allow for a DSL-like approach of defining more complex tests.
This initial seed only supports ${xmlunit.ignore} which can be
used to make XMLUnit ignore the element containing this text.
PR #105 by @zheng-wang.
added withDocumentBuilderFactory methods to HasXPathMatcher and EvaluateXPathMatcher to allow explicit configuration of the DocumentBuilderFactory used.
Issue #108.
the DocmentBuilderFactory and TransformerFactory instances used
by XMLUnit are now configured to not load any external DTDs or parse
external entities. They are now configured according to the OWASP
recommendations for XML eXternal Entity injection
preventions. The TransformerFactory used by the org.xmlunit.transform.Transformation class is still configured to
load external stylesheets, though.
For the legacy package XXE prevention has to be enabled via XMLUnit.enableXXEProtection explicitly.
This is a breaking change and you may need to provide DocmentBuilderFactory or TransformerFactory instances of your
own if you need to load external entities.
The SAXParserFactory and SchemaFactory instances used inside of
the validation package have not been changed as their use is
likely to require loading of external DTDs or schemas.
the configured NodeFilter is now applied before comparing DocumentType nodes.
This change breaks backwards compatibility as the old behavior was
to ignore DocumentType when counting the children of the Document node but not when actually comparing the DocumentType. Prior to this change if one document had a document
type declaration but the other didn't, a HAS_DOCTYPE_DECLARATION
difference was detected, this will no longer be the case now. If you
want to detect this difference, you need to use a more lenient NodeFilter than NodeFilters.Default
(i.e. NodeFilters.AcceptAll) but then you will see an additional CHILD_NODELIST_LENGTH difference.
The legacy package has been adapted and will behave as before even
when using NewDifferenceEngine.
added a new Source implementation ElementContentWhitespaceStrippedSource which is similar to WhitespaceStrippedSource but only affects text nodes that solely
consist of whitespace and doesn't affect any other text nodes. Also
added convenience ignoreElementContentWhitespace methods to DiffBuilder and CompareMatcher.
Issue #119.
The full list of changes for XMLUnit.NET:
add a new experimental module xmlunit-placeholders which aims to
use ${xmlunit.FOO} expressions inside of the control document to
allow for a DSL-like approach of defining more complex tests.
This initial seed only supports ${xmlunit.ignore} which can be
used to make XMLUnit ignore the element containing this text.
fixed the message when CompareConstraint or ValidationConstraints (both NUnit 2.x and 3.x) as well as EvaluateXPathConstraint or HasXPathConstraint (only the NUnit
3.x versions) pass but the assertion fails because the constraint
itself was wrapped in a Not constraint.
the NUnit 3.x EvaluateXPathConstraint failed to resolve the nested
constraint, leading to erroneous messages if the assertion failed.
Issue #25
the XmlDocument instances used internally in Convert and Transformation now get their XmlResolver property set to null
by default - which happens to be the default value of .NET 4.5.2 and
later anyway. This is in accordance with the OWASP recommendations
for XML eXternal Entity injection
preventions.
This may be a breaking change and you may need to provide an
explicit XmlResolver instance of your own if you need to load
external entities.
added a new ISource implementation ElementContentWhitespaceStrippedSource which is similar to WhitespaceStrippedSource but only affects text nodes that solely
consist of whitespace and doesn't affect any other text nodes. Also
added convenience IgnoreElementContentWhitespace methods to DiffBuilder and CompareConstraint.
Issue similar to xmlunit/#119.
the configured NodeFilter is now applied before comparing XmlDocumentType nodes.
This change breaks backwards compatibility as the old behavior was
to ignore XmlDocumentType when counting the children of the XmlDocument node but not when actually comparing the XmlDocumentType. Prior to this change if one document had a document
type declaration but the other didn't, a HAS_DOCTYPE_DECLARATION
difference was detected, this will no longer be the case now. If you
want to detect this difference, you need to use a more lenient NodeFilter than NodeFilters.Default
(i.e. NodeFilters.AcceptAll) but then you will see an additional CHILD_NODELIST_LENGTH difference.
These releases fix a few bugs and introduce smaller new features as
well as a completely new experimental module that aims to provide a
DSL that controls the diff process inside of the control XML document.
Starting with XMLUnit 2.6.0 all XML parsers are configured according
to OWASP recommendations for XML eXternal Entity injection
preventions
- which means you need to override certain settings if you need to
load external entities. This is a change that breaks backwards
compatibility - at least in the Java version. If you've been using
.NET 4.5.2 or above all configurations have been safe by default
anyway.
XXE prevention is not enabled inside of the validation package and
XMLUnit for Java's legacy module.
The full list of changes for XMLUnit for Java:
add a new experimental project xmlunit-placeholders which aims to
use
${xmlunit.FOO}expressions inside of the control document toallow for a DSL-like approach of defining more complex tests.
This initial seed only supports
${xmlunit.ignore}which can beused to make XMLUnit ignore the element containing this text.
PR #105 by
@zheng-wang.
added
withDocumentBuilderFactorymethods toHasXPathMatcherandEvaluateXPathMatcherto allow explicit configuration of theDocumentBuilderFactoryused.Issue #108.
the
DocmentBuilderFactoryandTransformerFactoryinstances usedby XMLUnit are now configured to not load any external DTDs or parse
external entities. They are now configured according to the OWASP
recommendations for XML eXternal Entity injection
preventions. The
TransformerFactoryused by theorg.xmlunit.transform.Transformationclass is still configured toload external stylesheets, though.
For the
legacypackage XXE prevention has to be enabled viaXMLUnit.enableXXEProtectionexplicitly.This is a breaking change and you may need to provide
DocmentBuilderFactoryorTransformerFactoryinstances of yourown if you need to load external entities.
The
SAXParserFactoryandSchemaFactoryinstances used inside ofthe
validationpackage have not been changed as their use islikely to require loading of external DTDs or schemas.
Issue #91.
NodeFilteris now applied before comparingDocumentTypenodes.This change breaks backwards compatibility as the old behavior was
to ignore
DocumentTypewhen counting the children of theDocumentnode but not when actually comparing theDocumentType. Prior to this change if one document had a documenttype declaration but the other didn't, a
HAS_DOCTYPE_DECLARATIONdifference was detected, this will no longer be the case now. If you
want to detect this difference, you need to use a more lenient
NodeFilterthanNodeFilters.Default(i.e.
NodeFilters.AcceptAll) but then you will see an additionalCHILD_NODELIST_LENGTHdifference.The legacy package has been adapted and will behave as before even
when using
NewDifferenceEngine.Issue #116.
SourceimplementationElementContentWhitespaceStrippedSourcewhich is similar toWhitespaceStrippedSourcebut only affects text nodes that solelyconsist of whitespace and doesn't affect any other text nodes. Also
added convenience
ignoreElementContentWhitespacemethods toDiffBuilderandCompareMatcher.Issue #119.
The full list of changes for XMLUnit.NET:
add a new experimental module xmlunit-placeholders which aims to
use
${xmlunit.FOO}expressions inside of the control document toallow for a DSL-like approach of defining more complex tests.
This initial seed only supports
${xmlunit.ignore}which can beused to make XMLUnit ignore the element containing this text.
fixed the message when
CompareConstraintorValidationConstraints(both NUnit 2.x and 3.x) as well asEvaluateXPathConstraintorHasXPathConstraint(only the NUnit3.x versions) pass but the assertion fails because the constraint
itself was wrapped in a
Notconstraint.the NUnit 3.x
EvaluateXPathConstraintfailed to resolve the nestedconstraint, leading to erroneous messages if the assertion failed.
Issue #25
the
XmlDocumentinstances used internally inConvertandTransformationnow get theirXmlResolverproperty set tonullby default - which happens to be the default value of .NET 4.5.2 and
later anyway. This is in accordance with the OWASP recommendations
for XML eXternal Entity injection
preventions.
This may be a breaking change and you may need to provide an
explicit
XmlResolverinstance of your own if you need to loadexternal entities.
Issue #27.
added a new
ISourceimplementationElementContentWhitespaceStrippedSourcewhich is similar toWhitespaceStrippedSourcebut only affects text nodes that solelyconsist of whitespace and doesn't affect any other text nodes. Also
added convenience
IgnoreElementContentWhitespacemethods toDiffBuilderandCompareConstraint.Issue similar to xmlunit/#119.
the configured
NodeFilteris now applied before comparingXmlDocumentTypenodes.This change breaks backwards compatibility as the old behavior was
to ignore
XmlDocumentTypewhen counting the children of theXmlDocumentnode but not when actually comparing theXmlDocumentType. Prior to this change if one document had a documenttype declaration but the other didn't, a
HAS_DOCTYPE_DECLARATIONdifference was detected, this will no longer be the case now. If you
want to detect this difference, you need to use a more lenient
NodeFilterthanNodeFilters.Default(i.e.
NodeFilters.AcceptAll) but then you will see an additionalCHILD_NODELIST_LENGTHdifference.Issue #26.