Reputation: 1
I am trying to find a method like the function sum() in XQuery that performs the same thing for product. Any help with that?
sum(/root//elemnts)
Upvotes: 0
Views: 39
Reputation: 167516
Use fold-left
e.g. fold-left(/root//elemnts, 1, function($p, $e) { $p * $e })
.
Upvotes: 2