xsl-list
[Top] [All Lists]

Re: [xsl] comparing sequences that contain more than one of the same item

2008-02-22 07:18:01
Andrew Welch wrote:
A bit of a Friday challenge...

Is it possible to compare to sequences such that items in the sequence
are consumed after the comparison?

For example, I want to compare two words to see if one is a subset of the other.

"farmer" and "frame"

If you do:

string-to-codepoints('farmer')[not(. = string-to-codepoints('frame'))]

the result is empty because the two r's in farmer are both being
compared to the single r in frame.

Currently I've a got a recursive function that removes each letter
after a match, but I'm wondering if there's a one-liner or some other
set based approach?


thanks

Dimitre Novatchev wrote to the list on a similar note on 18/04/07. He gave this link to his work with XSLT and anagrams:
http://dnovatchev.spaces.live.com/Blog/cns!44B0A32C2CCF7488!357.entry

        # r

--
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

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