xsl-list
[Top] [All Lists]

[xsl] Return the string that matches earliest -- Got a slick XPath expression that solves this?

2013-11-24 11:32:28
Hi Folks,

I have a pattern matching problem. It is explained easiest with an example.

Example: 
        Here is a string: aabQc
        Let's call it the sentential string.
        Do any of the following strings occur in 
        the sentential string:
                bQc
                cQ
        Let's call those strings the LHS strings.
        Clearly both LHS strings are contained
        in the sentential string. But bQc occurs
        earlier, so that is the correct answer.

Problem: Given a sentential string and a sequence of LHS strings, return the 
LHS string that occurs earliest in the sentential string. If multiple LHS 
strings occur earliest then return them all. Let $sentential be the sentential 
string and $LHS be a sequence of one or more LHS strings.

I'll bet there's a slick XPath expression that solves this problem.

Would you provide an XPath expression that solves this pattern matching problem 
please?

/Roger

--~------------------------------------------------------------------
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>