Class TextComparisonConfig

java.lang.Object
com.deltaxml.dita.config.TextComparisonConfig

public class TextComparisonConfig extends Object
These parameters control how text is compared and whitespace handled.
  • Constructor Details

    • TextComparisonConfig

      public TextComparisonConfig()
      Creates a new TextComparisonConfig instance. These parameters control how text is compared and whitespace handled.
  • Method Details

    • getWhitespaceProcessingMode

      public WhitespaceProcessingMode getWhitespaceProcessingMode()
      Gets the value of the whitespaceProcessingMode parameter.
      Returns:
      the value of the whitespaceProcessingMode parameter
    • setWhitespaceProcessingMode

      public void setWhitespaceProcessingMode(WhitespaceProcessingMode value)

      Specifies how to handle whitespace changes.

      When this option is set to 'show' whitespace differences are reported where possible. If the output-format is set to 'dita-markup', this will be wherever the DITA doctype allows text (as opposed to inter-element whitespace). For tracked-changes output formats, all whitespace changes can be shown.

      This can lead to a significant amount of marked change throughout the document. When the parameter is set to 'ignore', whitespace differences are not shown; instead the 'B' document's whitespace is kept where possible.

      Note that differences in whitespace are never ignored when the XML document explicitly states that the whitespace is important, via the xml:space attribute being set to 'preserve'.

      The 'automatic' setting effectively behaves as either 'normalize' or 'ignore' depending on the value of the 'preservation-mode' and the 'output-format' parameters. Here, 'normalize' is chosen when: (1) the lexical preservation mode is set to 'automatic' and the output format is 'dita-markup'; or (2) the lexical preservation mode is set to either 'document' or 'docAndAttrib'. In all other cases, the automatic preservation mode is treated as if it were 'ignore'.

      Default: WhitespaceProcessingMode.AUTOMATIC

      Parameters:
      value - the value to set for the whitespaceProcessingMode parameter
      Throws:
      IllegalArgumentException - if the value is null
    • isCharacterByCharacter

      public boolean isCharacterByCharacter()
      Gets the value of the characterByCharacter parameter.
      Returns:
      the value of the characterByCharacter parameter
    • setCharacterByCharacter

      public void setCharacterByCharacter(boolean value)

      Specifies whether to perform character by character comparison or not.

      If set to true, text is split into strings of characters for comparison. This allows individual character changes to be detected.

      Default: false

      Parameters:
      value - the value to set for the character-by-character parameter