Javatpoint Logo
Javatpoint Logo

XQuery concat() Function

The XQuery concat function is used to concatenate various strings.

Parameter explanation:

$input - It specifies one or more inputs separated by comma.


XQuery concat Example

Let's take an example to demonstrate the usage of XQuery concat function. Take an XQuery expression named "books.xqy", having the following code. It will concat the title and price from the given XQuery expression.

XQuery Expression:

books.xqy:

Create a Java based XQuery executor program to read the books.xqy, passes it to the XQuery expression processor, and executes the expression. After that the result will be displayed.

XQueryTester.java


Execute XQuery against XML

Put the above both files to a same location. We put them on desktop in a folder name XQuery14. Compile XQueryTester.java using console. You must have JDK 1.5 or later installed on your computer and classpaths are configured.

Compile:

javac XQueryTester.java

Execute:

java XQueryTester

Output:

XQUERY Concat function 1




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA