Implementation of XPath fn:collection() |
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.
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):
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.
Copyright © 2007, Colin Adams and others mailto:colin@colina.demon.co.uk http://www.gobosoft.com Last Updated: Sunday, December 16th, 2007 |