- markup (52)
- xml (7)
- xslt (21)
- atom (8)
- overlapping markup (2)
- schema (9)
- creole (4)
- xforms (1)
- pipelines (7)
- coding (2)
- dtll (1)
- genealogy (3)
- gtd (1)
- hardware (1)
- legislation (1)
- ontologies (2)
- unicode (1)
- web (24)
- google (3)
- rdf (6)
- rest (3)
- wikis (1)
- work (1)
- xpath (1)
- xquery (1)
- xtech2008 (3)
- life (26)
- children (5)
- equality (6)
- environment (4)
- gadgets (5)
- software (3)
- xlinq (2)
- conferences (7)
- xtech (6)
- blog (7)
- drupal (3)
Re: Levenshtein distance in XSLT 2.0
I’ve now made sufficient tweaks so both the function and the template versions are tail-recursive.
The template version wasn’t optimizing tail recursion in Saxon 8.9 for two reasons: (a) there’s no sensible static type inferencing being done for xsl:call-template (I think I was worried about the inferencing going into a loop when the call is recursive), and (b) there’s a blanket switch that says if the return type is declared, don’t do tail call optimization.
Keep these examples coming in: the only way to improve an optimizer is to give it lots of exercise.
The thing that really needs doing now (it’s long overdue) is some static analysis on apply-templates, using type information to narrow down the field of possible matching template rules.