[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Thought i knew this but i guess not
I guess, it's not that hard. You can have commas and spaces in any combination. How about this, assuming you're looking for $wantFilter: contains( concat( normalize-space( translate( @filter, ",", " " ) ), " " ), concat( $wantFilter, " " ) ) Russ, here are the steps: - First translate all commas to spaces - Then normalize-space -- look up that function if you don't know what it does. If all you have are spaces (and no tabs, for example) then you can skip this. - Add a space to the end, just for good measure - Also add a space to the end of the thing you're looking for. This prevents "filter1" from matching "filter11". - Then see if there's a match. On Tue, Feb 22, 2011 at 10:12 PM, Liam R E Quin <liam@xxxxxx> wrote: > On Tue, 2011-02-22 at 21:22 -0500, Chris Maloney wrote: >> On Tue, Feb 22, 2011 at 6:54 PM, Liam R E Quin <liam@xxxxxx> wrote: > >> > You want contains(concat(",", @filter, ","), ",filter1,") probably. >> >> Sorry to be kind of didactic here, but it won't work -- if you look at >> the example he gave earlier: > >> > The filter value can be of a form filter="filter1,filter10, filter17, filter23" something like that, so i need to do a little more testing. > >> he's got spaces and commas, at random -- it's a mess. > > Ugh, you are right. Although that might just be in an example for > xml-dev, just as "filter17" might really be "wears-dark-socks" for all I > know. > > Liam > > -- > Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ > Pictures from old books: http://fromoldbooks.org/ > The barefoot typographer
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|