How to declare the Concat function in XML using XQuery
In this article we will discuss about how to declare and use the XQuery function in XML.
This is one of the most important built-in-function in XQuery. This function concatenate two or more strings together means it is use to combine the two or more strings. This function must take at least two argument and further can take two or more argument but not less than two.
The syntax to declare the concat function in XQuery is as folows:
fn:concat ($string as xs:string?,$string as xs:string?[, ...]) as xs:string
Here fn is the prefix to the concat function and $string as xs:string is the name of the argument passed to it and as xs:string is return type of this function.
Here is the example to explain it.
|XQuery Concat Function Example
|concat('x' , 'y')
|concat('x', ( ) ,' y' , ' ', 'z')
|concat( ('x','y','z') )
|concat( 'x' , <a>y</a> , 'z')
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here