Sample xml:
between the element <a> & <b>, there is Text element which content is "\n ".
as IgnoreWhitespace, which should be ignored.
however, it will be trimmed, and add as a child node.
https://github.com/lovettchris/xmldiff/blob/master/src/XmlDiff/XmlDiffDocument.cs#L173
case XmlNodeType.Text:
{
string textValue = ( _XmlDiff.IgnoreWhitespace ) ? XmlDiff.NormalizeText( reader.Value ) : reader.Value;
XmlDiffCharData charDataNode = new XmlDiffCharData( ++childPosition, textValue, XmlDiffNodeType.Text );
charDataNode.ComputeHashValue( _xmlHash );
InsertChild( parent, charDataNode );
break;
}
if compare with this xml (IgnoreWhitespace):
because they have different child nodes,
they will have different HashValue,
as a result, xmlDiff.Compare() will return false.
Sample xml:
between the element
<a>&<b>,there is Text element which content is "\n ".as IgnoreWhitespace, which should be ignored.
however, it will be trimmed, and add as a child node.
https://github.com/lovettchris/xmldiff/blob/master/src/XmlDiff/XmlDiffDocument.cs#L173
if compare with this xml (IgnoreWhitespace):
because they have different child nodes,
they will have different HashValue,
as a result, xmlDiff.Compare() will return false.