file:list

Lists all files and directories in a given directory. The order of the items in the resulting sequence is not defined. The "." and ".." items are never returned. The returned paths are relative to the provided directory $dir.

list($dir as xs:string) ➔ xs:string*

Arguments

 

$dir

xs:string

Path to the directory

Result

xs:string*

list($dir as xs:string, $recursive as xs:boolean) ➔ xs:string*

Arguments

 

$dir

xs:string

Path to the directory

 

$recursive

xs:boolean

Whether the operation should recurse down though the filesystem tree

Result

xs:string*

list($dir as xs:string, $recursive as xs:boolean, $pattern as xs:string) ➔ xs:string*

Arguments

 

$dir

xs:string

Path to the directory

 

$recursive

xs:boolean

Whether the operation should recurse down though the filesystem tree

 

$pattern

xs:string

A glob pattern to match/filter file names

Result

xs:string*

Namespace

http://expath.org/ns/file

Links to specifications

EXPath File Module

Saxon availability

Available whether or not support for XPath 3.0 is enabled. Implemented since Saxon 9.5. Requires Saxon-PE or Saxon-EE.