Returns the URI of a resource where a document can be found, if available.
If the argument is omitted, it defaults to the context item (
behavior of the function if the argument is omitted is exactly the same as if the
context item had been passed as the argument.
$arg is the empty sequence, the function returns the empty sequence.
$arg is not a document node, the function returns the empty
Otherwise, the function returns the value of the
$arg, as defined in (See
The following errors may be raised when
$arg is omitted:
If the context item is absent, dynamic error
If the context item is not a node, type error .
In the case of a document node
$D returned by the
function, or a document node at the root of a tree containing a node returned by the
fn:collection function, it will always be true that either
fn:document-uri($D) returns the empty sequence, or that the following
expression is true:
$D. It is
implementation-defined whether this guarantee also holds for
document nodes obtained by other means, for example a document node passed as the
initial context node of a query or transformation.