From: Michael Kay <mike@sa...> - 2005-11-04 23:34:10
The problem here is that the previous implementation didn't conform to the
specification for document-uri() says that the result must satisfy
fn:doc(fn:document-uri($arg)) is $arg
The specification of document-uri() says you should return a value that
satisfies the above condition if you can, and return () otherwise. Since the
implementation of the collection() function hasn't retained a value that
satisfies this condition, it seemed right to return nothing. The alternative
of retaining extra information for use by document-uri() would be feasible,
but I'm not sure how useful it would be.
Have you considered getting the information you need from base-uri()? I
think that should give the same answer, but without the above guarantee.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of
> Rademacher, Gunther
> Sent: 04 November 2005 23:05
> To: saxon-help@...
> Subject: [saxon] fn:document-uri behaves differently with Saxon 8.6
> Thanks for Saxon 8.6.
> When running some XQueries against it, I noticed a difference
> in the result of fn:document-uri, when the documents are
> accessed by fn:collection with a directory argument, e.g.
> This now returns an empty result. However with a collection
> file, it works as it did for both variants with the previous
> I read that fn:document-uri has changed, but is this intended
> behaviour? Is there another way to get the document URI with
> the directory based collection variant?
> I found it rather handy to use fn:collection that way.
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App
> Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> saxon-help mailing list
> Have you considered getting the information you need from base-uri()?
> I think that should give the same answer, but without the above=20
Using base-uri instead of document-uri indeed solved my problem.