Method: ExistAPI#update_insert
- Defined in:
- lib/eXistAPI.rb
#update_insert(expr, pos, expr_single) ⇒ Object
Inserts the content sequence specified in expr into the element node passed via exprSingle. exprSingle and expr should evaluate to a node set. If exprSingle contains more than one element node, the modification will be applied to each of the nodes. The position of the insertion is determined by the keywords “into”, “following” or “preceding”:
-
Args :
-
expr-> The content is appended after the last child node of the specified elements.
e.g.: <email type=“office”>[email protected]</email>,
-
pos-> The content is inserted immediately after the node specified in exprSingle.
pos = “into” | “following” | “preceding”
-
expr_single-> The content is inserted before the node specified in exprSingle.
e.g. ‘//address’
-
-
Returns : -int handle of query
-
Raises :
-
nothing
-
306 307 308 309 310 311 312 |
# File 'lib/eXistAPI.rb', line 306 def update_insert(expr, pos, expr_single) query = "update insert "+expr+" "+pos+" "+expr_single #puts "query #{query}" execute_query(query) rescue => e raise e end |