# fn:insert-before

fn:insert-before(item()* $target, integer $position, item()* $inserts) → item*

Function signature

$target | item() *
$position | xs:integer
$inserts | item() *
Result | item() *

Insert an item into a sequence

XPath 2.0 Specification

Implemented. Changed in 7.4 to reflect the latest WD which changes the name from insert to insert-before, and inserts the new items before the selected position, not after it as previously. Changed in 7.8 to allow the insert position to be beyond the end of the original sequence (which causes the new sequence to be appended).

Expand | Up Next