xsl-list
[Top] [All Lists]

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

2007-10-05 08:41:54
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>