[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: lightweight counterpart for collection()

Subject: Re: lightweight counterpart for collection()
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 20 Aug 2005 06:40:36 +0100
companies email directory
>>>>> "Manfred" == Manfred Staudinger <manfred.staudinger@xxxxxxxxx> writes:

    Manfred> Hi list, As I recently ran into storage problems with
    Manfred> collection() I would like to see a lightweight
    Manfred> counterpart with the following features:

The version you are requesting is not lightweight - on the contrary:

    Manfred> collection() for one directory - on invocation gets a
    Manfred> sequence (dir-seq) representing the documents in the
    Manfred> directory, the order determined by the full URI,
    Manfred> including the member-name

Firstly, there is no requirement for an implementation to provide a
mapping of URIs to a directory. An implementation is compliant if it
raises error FODC0004 for any URI passed to collection().

Requiring that the node sequence is returned in order (which order?),
makes the function more heavyweight - the implementation MUST perform
sorting - the function as specified in the draft avoids sorting - you
get the choice whether to sort or not.
If your desire is rather for conciseness, then you can wrap the call
to collection() in an xsl:function.

    Manfred> If the function is called
    Manfred> again, it reuses the dir-seq.  - each document is fetched
    Manfred> only once from directory when it is referenced for the
    Manfred> first time.

I suspect this is already a requirement of the specification - it says
the function is stable, but does not further specify what this means
(unlike for fn:doc(), where it is explicit).

    Manfred> It will be discarded automatically if an
    Manfred> other document from the same dir-seq is referenced and it
    Manfred> will not be re-fetched later on.

This would cause subtle errors in transformations, because execution order
is not proscribed.
So a later occurring call to fn:doc() for one of the documents in the
collection would have to fail, contradicting the specification for
fn:doc - e,g.:

if during the execution of a transformation , the following events
occurred:

fn:doc (uri-A)
fn:manfred-collection (uri-B)
fn:doc (uri-A)

and uri-A maps to one of the documents in the collection mapped by
uri-B, then you have a contradiction between the requirements of
fn:doc (the nodes returned by the two calls are identical) and your requirement.

-- 
Colin Adams
Preston Lancashire

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.