home contribute faq download

FunctX XQuery Functions

functx:is-value-in-sequence

Whether an atomic value appears in a sequence

Google
Webxqueryfunctions.com

Description

The functx:is-value-in-sequence function returns a boolean value indicating whether or not an atomic value is equal (based on typed values) to a value in the sequence. If $value or $seq is the empty sequence, it returns false.

Arguments and Return Type

NameTypeDescription
$value xs:anyAtomicType? the atomic value to test
$seq xs:anyAtomicType* the sequence of values to search
return value xs:boolean

XQuery Function Declaration

See XSLT definition.
XQuery Syntax for January 2007 (1.0):
declare namespace functx = "http://www.functx.com"; 
declare function functx:is-value-in-sequence 
  ( $value as xs:anyAtomicType? ,
    $seq as xs:anyAtomicType* )  as xs:boolean {
       
   $value = $seq
 } ;
XQuery Syntax for July 2004 - November 2005 (CR):
declare namespace functx = "http://www.functx.com"; 
declare function functx:is-value-in-sequence 
  ( $value as xdt:anyAtomicType? ,
    $seq as xdt:anyAtomicType* )  as xs:boolean {
       
   $value = $seq
 } ;
XQuery Syntax for May 2003:
declare namespace functx = "http://www.functx.com" 
define function is-value-in-sequence 
  ( $value as xdt:anyAtomicType? ,
    $seq as xdt:anyAtomicType* )  as xs:boolean {
       
   $value = $seq
 }

Examples

XQuery ExampleResults
functx:is-value-in-sequence(1,(1,2,3))
true
functx:is-value-in-sequence(5,(1,2,3))
false
functx:is-value-in-sequence(1.0,(1,2,3))
true

See Also

functx:is-node-in-sequence-deep-equalWhether an XML node is in a sequence, based on contents and attributes
functx:is-node-in-sequenceWhether an XML node is in a sequence, based on node identity

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