public class Options
extends java.lang.Object
XmlUtils
.
We support the following options:
normalizeTextNodes when set to true
text nodes will
be normalized in the inputs that are passed to
the XmlUtils
methods. Normalization
involves two steps: coalescing adjacent text nodes,
followed by stripping leading and trailing
whitespace from the coalesced node. Note that single
text nodes will have the leading and trailing whitespace
stripped, and whitespace only text nodes will be
essentially disregarded by the XmlUtils
methods after normalization.
The normalization is set to true
by default.
If the user wishes to implement a different normalization
prior to invoking XmlUtils
, the
default normalization must be explicitly turned off by invoking
normalizeTextNodes(false)
.
includeXPaths when set to true
XPath locations will
be provided in the returned DiffOp
objects.
Please note that for maximum performance this option
should be set to false
, which is the default value.
ignorePrefixDifferences when set to true
namespace prefixes will be
considered equal in the provided XmlUtils
methods,
even if they are different but map to the same namespaceURI
.
The default value of this option is true
.
Constructor and Description |
---|
Options() |
Options(boolean normalizeTextNodes,
boolean includeXPaths,
boolean ignorePrefixDifferences) |
Options(Options opt) |
Modifier and Type | Method and Description |
---|---|
boolean |
ignoreNamespaceDeclarations() |
void |
ignoreNamespaceDeclarations(boolean ignoreNamespaceDeclarations) |
boolean |
ignorePrefixDifferences() |
void |
ignorePrefixDifferences(boolean ignorePrefixDifferences) |
boolean |
includeXPaths() |
void |
includeXPaths(boolean includeXPaths) |
boolean |
normalizeTextNodes() |
void |
normalizeTextNodes(boolean normalizeTextNodes) |
public Options()
public Options(boolean normalizeTextNodes, boolean includeXPaths, boolean ignorePrefixDifferences)
public Options(Options opt)
public void normalizeTextNodes(boolean normalizeTextNodes)
public boolean normalizeTextNodes()
public void includeXPaths(boolean includeXPaths)
public boolean includeXPaths()
public void ignorePrefixDifferences(boolean ignorePrefixDifferences)
public boolean ignorePrefixDifferences()
public void ignoreNamespaceDeclarations(boolean ignoreNamespaceDeclarations)
public boolean ignoreNamespaceDeclarations()
Copyright © 2020, 2024, Oracle and/or its affiliates.