Project

Profile

Help

DefaultCollection feature

Added by Anonymous about 18 years ago

Legacy ID: #3967578 Legacy Poster: Diego von Sohsten (dsohsten)

Hi, Still on tests... I saw that there's no such thing like a DefaultCollection, when you use fn:collection() you get a null. So I tried to implement a class like that : public class DefaultCollectionResolver extends StandardCollectionURIResolver { private final String defaultCollection; public DefaultCollectionResolver(String defaultCollection) { super(); this.defaultCollection = defaultCollection; } public SequenceIterator resolve(final java.lang.String href, final java.lang.String base, final XPathContext context) throws XPathException { return super.resolve((href==null? defaultCollection : href), base, context); } } But I have a question: There's some design reason to not implement a Default Collection ? Or its not implemented just because no one implemented it yet ? Thanks, Diego.


Replies (2)

RE: DefaultCollection feature - Added by Anonymous about 18 years ago

Legacy ID: #3967623 Legacy Poster: Michael Kay (mhkay)

The only reason I didn't provide a default collection in Saxon is that I wasn't sure what people would want it to mean. It could mean the current working directory, for example, or it could be a directory identified by an environment variable. I thought I'd wait and see if a consensus emerged among other implementations.

RE: DefaultCollection feature - Added by Anonymous about 18 years ago

Legacy ID: #3968296 Legacy Poster: Diego von Sohsten (dsohsten)

As I thought, there is some reason to not implement it. Even so, if someone needs, for some reason, to use default collections it is very easy to implement one. Thanks, Diego.

    (1-2/2)

    Please register to reply