Method: ExistAPI#update_replace

Defined in:
lib/eXistAPI.rb

#update_replace(expr, expr_single) ⇒ Object

Replaces the nodes returned by expr with the nodes in exprSingle. expr may evaluate to a single element, attribute or text node. If it is an element, exprSingle should contain a single element node as well. If it is an attribute or text node, the value of the attribute or the text node is set to the concatenated string values of all nodes in exprSingle.

  • Args :

    • expr -> e.g.: //fname[. = “Andrew”]

    • expr_single -> <fname>Andy</fname>

  • Returns : -int handle of query

  • Raises :

    • nothing



328
329
330
331
332
333
# File 'lib/eXistAPI.rb', line 328

def update_replace(expr, expr_single)
  query = "update replace "+expr+" with "+expr_single
  execute_query(query)
rescue  => e
  raise e  
end