cardinality()

Additional XPath Functions

cardinality

Returns whether an XPath expression returns zero, one or more than one node


Function Summary
 
minimal arguments Boolean cardinality (XPath expression , String cardinality)
 
all arguments Boolean cardinality (XPath expression , String cardinality)
 

Required Arguments
 
XPath expression an XPath expression that returns some number of nodes
String cardinality Contains any combination of the characters '0', '1' and 'M'.

There are no optional arguments
 

Example
 
cardinality(/root/plugin , "1M")

returns true if there are one or more child elements named "plugin" under the top-level node named "root", or false otherwise.


© Copyright IBM Corporation 2000, 2006. All Rights Reserved.