Loading TOC...

MarkLogic 9 Product Documentation
fn:doc-available

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

Summary

If fn:doc($uri) returns a document node, this function returns true. If $uri is not a valid xs:anyURI, an error is raised [err:FODC0005]. Otherwise, this function returns false.

If this function returns true, then calling fn:doc($uri) within the same execution scope must return a document node.

Parameters
uri The URI of the document to check.

Example

fn:doc-available("/mydocs/doc.xml")

=> true is /mydocs/doc.xml is a document in the database
   otherwise false

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.