Javatpoint Logo
Javatpoint Logo

XQuery Sequences

XQuery sequences are used to specify an ordered collection of items. These items can be of similar or different types.

Creating a sequence

An XQuery sequence is created using parenthesis with strings inside quotes or double quotes or numbers. XML elements can also be used as the items of a sequence.

There are two ways to create items of sequence iterated one by one.

  • Using index
  • Using values

XQuery Expression for Index


How to run

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

Execute XQuery against XML

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




java XQueryTester


XQUERY Sequence 1

XQuery Expression for Index


Follow the same procedure as above:


XQUERY Sequence 2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA