Hi Ben,
1: How can I achieve the same task, using functx:remove-elements and update:for-each?
It would look like this:
import module namespace functx = 'http://www.functx.com';
let $names := ('db1', 'db2') return update:for-each( collection("TextMining/nl-verbs.csv")/csv/record, function($record) { replace node $record with functx:remove-elements($record, $names) } )
2: What's the benefit of using the update module?
The functions in the Update Module have been designed to perform advanced update operations with higher-order functions in complex applications; see [1] for a first introduction. For most trivial update scenarios, the XQuery Update features [2] will be sufficient and will usually be more readable.
Hope this helps Christian
[1] http://docs.basex.org/wiki/Higher-Order_Functions [2] http://docs.basex.org/wiki/XQuery_Update