There are a variety of ways to achieve a case insensitive comparison, with varying degrees of accuracy. We outline two of the simpler approaches now:
- Normalize inputs approach: Use an input filter to convert all the text within the document to lower (or upper) case.
- Simple output filtering approach: Use the ignore change output filter processing to ignore 'case changes'.
In the remainder of this guide we provide further explanation of the above approaches, along with some illustrative example XSLT scripts, which enable text changes within text nodes and attribute values to be compared in a case insensitive manner. It would be straightforward to extend the case insensitive comparison to handle both comments and processing instructions.
Limitation: The example scripts do not take 'i18n - international language' considerations into account, so the use of 'lower-case' XSLT function might need to be updated to appropriately normalise a given languages text string for the purposes of a comparison.
2. Normalize inputs approach filter
The normalize inputs approach requires that all the text within the input documents is converted to either lower or upper case. The following XSLT filter that provides an example of how lower case normalisation of the inputs can be applied for English text.
3. Simple output filtering approach
The simple output filtering approaches involves:
deltaxml:textGroupswhose only change is within the 'case' of its string value;
- optionally identify 'case' of attribute values (the children of the
- writing a filter to marking these changes with the appropriate
- applying the ignore change processing filters.
The following XSLT filter provides an example of stage 3 of the above approach, i.e. the initial markup script for the 'ignore changes' processing (for English text).