How to use insert-before operation in Function on sequence Using XPath in Xml

In this article I will explain insert-before operation of function on sequence.
  • 2250

Introduction

The insert-before operation of Function on sequence can be used to insert the data or value before the specified value or data, and also display the number of data that we specify.

Syntax

insert-before ((item,item,item,item....),position,inserts)

In the sequence the the first argument of list displayed the number of items or the sequence, the second argument describe the position where we want to insert the value suppose if I write the position 1 then it display the data before the 1 element in the sequence and the third argument is the value that we insert in the sequence.

Example

insert-before (("ab", "cd", "ef", "ij", "kl"), 4, "gh")
insert-before (("ab", "cd"), 1, "pq")
insert-before (("Name", "Address", "Contact"), 2, "Email")

Output

( "ab" , "cd" , "ef" , "gh" , "ij" , "kl" )
( "pq" , "ab", "cd" )
( "Name" , "Email" ,"Address" , "Contact")

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.