Ice Bear SoftSaxon Extension

This package contains a small extension function which can report the file modification time in the ISO 8601 format. It was tested with Saxon 8.5. It will not work with Saxon 6.x and older because the package names have changed.

Note: These functions were modified by Michael Kay and included as Saxon extension functions.

Contents

1. zw:last-modified() as xs:dateTime
2. zw:last-modified(node $node) as xs:dateTime
3. zw:file-timestamp(xs:string filename) as xs:dateTime
4. Installation and usage
5. Test
6. Compilation
7. Note for OS/2 (eComStation) users
8. Download

1. zw:last-modified() as xs:dateTime

The function returns the modification time of the file containing the context node. If the node does not belong to a file on a local disk, an empty string is returned.

2. zw:last-modified(node $node) as xs:dateTime

The function returns the modification time of the file containing the specified node. If the node does not belong to a file on a local disk, an empty string is returned.

3. zw:file-timestamp(xs:string filename) as xs:dateTime

The function returns the modification time of the file the name of which is supplied as a parameter. The name must not contain the file: prefix. If the file does not exist, an empty string is returned. If you wish to get modification time of an XML file, it is preferable to use zw:last-modified(document("filename.xml")).

4. Installation and usage

After unzipping the distribution you will get extutils.jar in the lib subdirectory. Before calling Saxon you have to add this file to your CLASSPATH or specify it in the -classpath argument. You then have to declare the following namespace in your stylesheet (you can use any namespace prefix, zw: is just an example):

xmlns:zw="java:cz.euweb.icebearsoft.saxon.ExtUtils"

5. Test

The distribution contains the stylesheet test.xsl which demonstrates usage and can be used for testing. You can also use the command line test. You have to put both extutils.jar and saxon8.jar to your CLASSPATH and invoke:

java cz.euweb.icebearsoft.saxon.ExtUtils filename ...

You may specify any number of file names. The module will display all system properties and the file modification times for each file.

If you have extutils.jar and saxon8.jar in the same directory, you can use a simpler way (of course the path to extutils.jar must be specified):

java -jar extutils.jar filename ...

The simpler method works since version marked in MANIFEST.MF as:

Implementation-Version: 1.0.0

6. Compilation

The distribution contains the Ant build file and the environment setting scripts for OS/2 and Linux. It is assumed that the SAXON8_JAR environment variable contains the full path to your saxon8.jar. If you are using Linux, your ~/.antrc must contain:

if [ -f .antrc ] ; then
  . .antrc
fi

The module was developed in OS/2, the files therefore have DOS line endings.

7. Note for OS/2 (eComStation) users

If you are using Innotek java, be sure that you have the latest version. Version 1.4.2_02 did not handle correctly daylight savings, version 1.4.2_05 works well.

8. Download

Download extutils.zip 12 KB