Saxonica.com

saxon:file-last-modified()

saxon:file-last-modified(uri as xs:string()) ==> xs:dateTime?

This function returns the date/time when a file was modified. It returns the empty sequence if the information is not available, or if any errors occur.

The argument must be an absolute URI. It has been tested with URIs using the file and http schemes, and is not guaranteed to give a result with other URI schemes (or indeed with these, under all circumstances). To generate an absolute URI, if necessary, use the functions resolve-uri() and static-base-uri().

The function returns an xs:dateTime value which will usually be in a specific timezone. The result can therefore be formatted using the format-dateTime function, or input to arithmetic and comparisons against other dates and times.

To get diagnostics in the event of an error, set the -TJ option on the command line or the TRACE_EXTERNAL_FUNCTIONS configuration option.

Example:

format-dateTime(file-last-modified(resolve-uri('lookup.xml', static-base-uri()))

See also last-modified()

Next