You could use a trick. Sequences returned from a sequence
expression are always flattened and concatenated. So:
for $city in ('Hamburg', 'Coblenz', 'Aachen') return (if
(contains('Hamburger', $city)) then true() else ())
...returns true(), because the empty sequences are simply
discarded.
Not a good idea. If the input was "von Hamburg nach Aachen" the result would
be (true(), true()), and applying boolean() to that result gives an error.
And you don't need a trick here anyway, because
some $city in ('Hamburg', 'Coblenz', 'Aachen') satisfies (contains($input,
$city))
solves the problem perfectly well.
Or, if you prefer brevity, you can write
exists(('Hamburg', 'Coblenz', 'Aachen')[contains($input, .)])
Michael Kay
http://www.saxonica.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>
--~--