[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Sorting substitution instructions by max. length of matches


Subject: Re: [xsl] Sorting substitution instructions by max. length of matches
From: "Yves Forkl (SRZ)" <Y.Forkl@xxxxxx>
Date: Fri, 05 Oct 2007 17:41:20 +0200

David Carlisle wrote:
I'd probably use analyze-string rather than using an explicit recursion to do the lookup.

Thank you for this solution which is really elegant. Once I have seen this, I come to think that I've exposed a rather trivial problem... :-)


(I think in both cases they may fail to find the longest match possible, as earlier matches may obscure a possible later longer match)

You are definitely right that I have to face this issue which I admittedly failed to notice, and that this problem is common to both approaches.


Can you think of an example of an input text and a regex with matches that would overlap in this way? (Each regex's matches will be checked in a pass of its own, so it must be matches of the same regex.) I tried but could not find an example within some time.

Yves


Current Thread