Created
October 20, 2011 06:45
-
-
Save grtjn/1300569 to your computer and use it in GitHub Desktop.
A small example of XQuery code that searches for books with the string ‘XQuery’ in its title..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version '1.0'; | |
(: A small example of XQuery code that searches for books with the string ‘XQuery’ in its title.. :) | |
<html> | |
<body> | |
<ul>{ | |
(: Search all books :) | |
for $b in collection('books')/book | |
(: Take those with XQuery in its title :) | |
where contains($b/title, 'XQuery') | |
(: Make an HTML result list out of it :) | |
return | |
<li>{ data($b/title) }</li> | |
}</ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment