FLWOR Expressions |
||
The FLWOR expressions form the building blocks of XQuery. The FLWOR name is derived from the first character of the following five keywords:
The following XQuery expression uses FLWOR expressions to search child elements of the book elements for a price element that contains a value greater than 40 and to select the title child elements of such book elements: for $x in doc("books.xml")/bookstore/book In the preceding XQuery expression, the for clause selects all the book elements in the bookstore element into a variable called $x. The where clause refines the selection to include only those book elements that have a price element with a value greater than 40. The order by clause defines the sort order and the return clause specifies that the title elements should be returned. The following code is the output of the preceding XQuery expression when applied to the code snippet on the right: <title>TITLE2</title> |
|
|
Click the Next button to continue. |