File System Example▲
Sélectionnez
declare variable $where as xs:string :=
string($fileTree/
@filePath);
&
lt;html&
gt;
&
lt;head&
gt;
&
lt;title&
gt;All cpp files in: {
$where}&
lt;/
title&
gt;
&
lt;/
head&
gt;
&
lt;body&
gt;
&
lt;p&
gt;
cpp-
files found in {
$where}
sorted by size:
&
lt;/
p&
gt;
&
lt;ul&
gt; {
for
$file in $fileTree//file[@suffix = "cpp"]
order by xs:integer($file/
@size)
return
&
lt;li&
gt;
{
string($file/
@fileName)}
, size: {
string($file/
@size)}
&
lt;/
li&
gt;
}
&
lt;/
ul&
gt;
&
lt;/
body&
gt;
&
lt;/
html&
gt;