August 2003
Beginner to intermediate
240 pages
7h 44m
English
count-non-empty( ) — returns the count of all the non-empty nodes in the node-set operands
| Defined in: XForms 1.0 |
Parameters: node-set operands (required) |
| Return type: number |
For the purposes of this function, “non-empty” means a string-value of one or more characters. This can be useful when computing an average that disregards empty values.
For an XPath data model representing the following XML:
<operands> <operand>3.14</operand> <operand>42</operand> <operand/> <operand>0.86</operand> </operands>
The following XPath expression returns 15.333333333333334:
sum(/operands/operand) div count-non-empty(/operands/operand)
Read now
Unlock full access