diff-for-xslt2 global variables, keys, and functions summarized

Option 1 (diff-for-xslt2)

tan:diff($string1 as xs:string?, $string2 as xs:string?) as element()

two-parameter version of the full version below. The stagger and diminishment

factors are designed to get small as the length of the shortest string gets larger.

Used by template ŧ class-1-errors

Used by function tan:diff()

Relies upon tan:diff .

Option 2 (diff-for-xslt2)

tan:diff($string1 as xs:string?, $string2 as xs:string?, $diminishment-base as xs:double, $diminishment-exp-adjustment as xs:double, $stagger-base-adjustment as xs:double, $stagger-exp-adjustment as xs:double) as element()

Input: any two strings.

Output: The differences between the two strings in the form of:

<diff>

<s1>[text unique to string 1]</s1>

<s2>[text unique to string 2]</s2>

<common>[text shared by both strings]</common>

</diff>

The algorithm is designed for XSLT 2, in which too many nested loops prove fatal, and with

the assumption that the user could settle for a difference that finds a long common substring,

and not perhaps the longest common substring.

Used by template ŧ class-1-errors

Used by function tan:diff()

Relies upon tan:diff-loop .