fn:doc-available

The function returns true if and only if the function call fn:doc($uri) would return a document node.

Signature

fn:doc-available($uri as xs:string?) as xs:boolean

Properties

This function is deterministic, context-dependent, and focus-independent. It depends on available documents, and static base URI.

Rules

If $uri is an empty sequence, this function returns false.

If a call on fn:doc($uri) would return a document node, this function returns true.

In all other cases this function returns false. This includes the case where an invalid URI is supplied, and also the case where a valid relative URI reference is supplied, and cannot be resolved, for example because the static base URI is absent.

If this function returns true, then calling fn:doc($uri) within the same execution scope must return a document node. However, if nondeterministic processing has been selected for the fn:doc function, this guarantee is lost.