[xsl] Filtering based on "list" of values

Subject: [xsl] Filtering based on "list" of values
From: "Chris Ward" <cward@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 9 Jan 2006 10:38:39 -0000
Hi all,

Sorry if this is a commonly asked question - I've looked in
the archive but the best match was my first posting back in 2003!
http://www.biglist.com/lists/xsl-list/archives/200311/msg00700.html

Anyway, I've returned to the world of XSLT now and I face the same
problem.


Imagine some XML such as...

<root>
    <store location="london">

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

    </store>
    <store location="paris">

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

    </store>
    <store location="madrid">

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

    </store>
    <store location="new york">

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

    </store>
    <store location="tokyo">

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

    </store>
</root>


I've got a webpage/form that allows the user to enter a list
of locations they want included in a report (I have the report
XSLT already).

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"


I happen to be using dom4j/Java.  I do use XMLFilterImpl in
my code for filtering other XML stuff, but I wondered if I can do
the filtering inside the XSLT.  I am now running the latest version
of Saxon therefore XSLT 2.0.  I'm new to XSLT 2.0 and not sure if
it's possible using functions or something.

It's STILL not clear to me where to do this sort of list-based
filtering.


Many thanks for any suggestions.

Chris Ward

Current Thread