xsl-list
[Top] [All Lists]

Re: Filtering based on "list" of values

2006-01-09 03:54:15
----- Original Message ----- From: "andrew welch" <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, January 09, 2006 10:42 AM
Subject: Re: [xsl] Filtering based on "list" of values


Imagine some XML such as...

<root>
    <store location="london">

        <...>report data here</...>

    </store>
[snip]
</root>

I guess I am thinking about passing something into the XSLT (via a
param) along the lines of

        "london,new york"

        or

        "tokyo, paris, london"

How about:

<xsl:apply-templates select="/root/store[contains($param, @location)]"/>

cheers
andrew

If you're going to do that it maybe better to delimit both sides, with commas for instance, otherwise you will get yor "New York" store when you search for "York".

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