home contribute faq download

FunctX XSLT Functions

functx:contains-any-of

Whether a string contains any of a sequence of strings

Google
Webxsltfunctions.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

XSLT Function Declaration

See XQuery definition.
<xsl:function name="functx:contains-any-of" as="xs:boolean"
              xmlns:functx="http://www.functx.com">
  <xsl:param name="arg" as="xs:string?"/>
  <xsl:param name="searchStrings" as="xs:string*"/>

  <xsl:sequence select="
   some $searchString in $searchStrings
   satisfies contains($arg,$searchString)
 "/>

</xsl:function>

Examples

XPath 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
Datypic XSLT Services

Recommended Reading:

XQuery