HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
In the following example we will continue to use this "books.xml" (same XML file and the section above is used) document.
See "books.xml" file in your browser .
As seen in the previous chapter, we use the FLWOR expression or a path expression to select and filter elements.
Consider the following FLWOR expression:
statement for the variable tied to each item returned by the in expression. for statement Iteration. There may be multiple for the same statement in a FLWOR expression.
For a specified number of times in a for statement to loop, you can use keywords to:
result:
Keywords can be used to calculate the iteration at:
result:
In the statement also allows for more than one in expression. Please use a comma to separate each in expression:
result:
let statement can be complete variable distribution, and avoid repeated the same expression. let statement does not cause iteration.
result:
where statement is used to set the result of one or more conditions (criteria).
order by statement to sort the results of a predetermined order. Here, we want to sort the results according to category and title:
result:
return statement specifies to return the contents.
result: