summaryrefslogtreecommitdiff
path: root/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
diff options
context:
space:
mode:
Diffstat (limited to 'examples/xmlpatterns/filetree/queries/listCPPFiles.xq')
-rw-r--r--examples/xmlpatterns/filetree/queries/listCPPFiles.xq19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/xmlpatterns/filetree/queries/listCPPFiles.xq b/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
new file mode 100644
index 0000000..e311d27
--- /dev/null
+++ b/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
@@ -0,0 +1,19 @@
+declare variable $where as xs:string := string($fileTree/@filePath);
+<html>
+ <head>
+ <title>All cpp files in: {$where}</title>
+ </head>
+ <body>
+ <p>
+ cpp-files found in {$where} sorted by size:
+ </p>
+ <ul> {
+ for $file in $fileTree//file[@suffix = "cpp"]
+ order by xs:integer($file/@size)
+ return
+ <li>
+ {string($file/@fileName)}, size: {string($file/@size)}
+ </li>
+ } </ul>
+ </body>
+</html>