SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Notices
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
| Additional serialization parameters
» | Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# 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