Comparison Options for Whitespace Characters

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Comparing Files > Modifying the File Comparison Options >

Comparison Options for Whitespace Characters

Whitespace characters are any of the following: space, tab, carriage return, and line feed. You can change the comparison options for whitespace characters from the Tools | Comparison Options menu.

dd_whitespace_comparison

When Compare as is option is enabled, Text A is considered equal to Text B if characters in Text A (including whitespace characters) correspond to those in Text B. The whitespace characters are relevant for comparison.

 

When Normalize option is enabled, Text A is equal to Text B if, after normalization, characters in Text A correspond to those in Text B. “Normalization” means that multiple consecutive occurrences of whitespace characters are replaced by a single space character. Also, the leading and trailing whitespace characters are trimmed for each line of text.

 

Note:In case of XML ( dd_ic_xml ) comparison, the leading and trailing whitespace characters in attribute values are trimmed.

 

When Strip all option is enabled, Text A is considered equal to Text B if, after stripping whitespace characters, characters in Text A correspond to those in Text B. In other words, any whitespace characters are stripped from the text and considered not relevant for comparison.

 

Note:In case of XML comparison ( dd_ic_xml ), whitespace characters that are outside attribute or element values are disregarded for comparison. This is true for any of the whitespace options above.

 

The following table illustrates differences when comparing text with each option, using text ( dd_ic_txt ) or Word comparison.

 

Text A

Text B

Compare as is

Normalize

Strip all

"a"

"a "

not equal

equal

equal

"a"

" a"

not equal

equal

equal

"a a"

"a  a"

not equal

equal

equal

 

The following table illustrates differences when comparing text with each option, using XML ( dd_ic_xml ) comparison.

 

Text A

Text B

Compare as is

Normalize

Strip all

<?xml version="1.0"

<?xml   version="1.0"

equal

equal

equal

<book id="1">

<book id=" 1 ">

not equal

equal

equal

<author>Mark Twain</author>

<author>Mark   Twain</author>

not equal

equal

equal


© 2019 Altova GmbH