Implementation of XPath fn:collection() PreviousNext

URIs to be passed as the argument to fn:collection() are implementation-defined. This library provides a fully customizable interface, along with an extensible default implementation.

In order to provide your own implementation, you must call set_collection_resolver from XM_XPATH_CONFIGURATION.

Default implementation

The default implementation provided by the library is implemented in class XM_XPATH_DEFAULT_COLLECTION_RESOLVER, along with class XM_XPATH_COLLECTION_FILE_SCHEME_RESOLVER, and in class XM_XPATH_DEFAULT_COLLECTION_SCHEME_RESOLVER for the default collection (equivalent to passing a file: URI pointing to the current working directory).

Class XM_XPATH_COLLECTION_FILE_SCHEME_RESOLVER resolves URIs in the file scheme. The URI must point to a directory on the local disk, and it must end in a /. The resulting collection of nodes consists of document nodes, each containing a single element in the namespace http://www.gobosoft.com/eiffel/gobo/gexslt/extension. The local name of the element is either directory or file. The element has no child element and a single text node naming the file or directory - all the additional information is expressed as attributes.

The following attributes are present (integer values are as in the POSIX stat system call):

xml:base
Base URI for the element

In the case of a file element, this is suitable for passing to the fn:doc() function.

In the case of a directory element, this is suitable for passing to the fn:collection() function. In this way, recursive directory listings are possible.

protection
Integer value denoting the access rights (decode as 12 bits)
inode
Inode number
size
File size in bytes
user
UID
group
GID
date
Last modification date
access-date
Last access date
change-date
Last change date
device
Device number on which inode resides
device-type
Device type on which inode resides
links
Number of links
owner-name
Name of file owner from /etc/passwd, or UID if not available
group-name
Name of file's owning group from /etc/group, or GID if not available


Copyright © 2007, Colin Adams and others
mailto:colin@colina.demon.co.uk
http://www.gobosoft.com
Last Updated: Sunday, December 16th, 2007
HomeTocPreviousNext