home contribute faq download

FunctX XQuery Functions

functx:contains-any-of

Whether a string contains any of a sequence of strings

Google
Webxqueryfunctions.com

Description

The functx:contains-any-of function performs the fn:contains function on a sequence of strings, returning true if $arg contains any one of the values in $searchStrings.

Arguments and Return Type

NameTypeDescription
$arg xs:string? the string to test
$searchStrings xs:string* the strings to look for
return value xs:boolean

XQuery Function Declaration

See XSLT definition.
declare namespace functx = "http://www.functx.com";
declare function functx:contains-any-of
  ( $arg as xs:string? ,
    $searchStrings as xs:string* )  as xs:boolean {

   some $searchString in $searchStrings
   satisfies contains($arg,$searchString)
 } ;

Examples

XQuery ExampleResults
functx:contains-any-of('abc',('bc','xy'))
true
functx:contains-any-of('abc',('de','xy'))
false

See Also

fn:containsWhether one string contains another

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Need XQuery Help?
D A T Y P I C
Training | Consulting | Development

XQuery by Priscilla WalmsleyGet the book!
XQuery by Priscilla Walmsley