home contribute faq download

FunctX XSLT Functions

fn:doc-available

Whether a document is available

Google
Webdatypic.com

Description

The fn:doc-available function is a way to avoid the errors returned by the fn:doc function if a document is not available. This function will return true if calling the fn:doc function on the same URI will result in a document node. It will return false if the fn:doc function would not return a document node.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

NameTypeDescription
$uri xs:string? the URI of the document to check for
return value xs:boolean

Examples

XPath ExampleResults
doc-available(
   'https://www.datypic.com/functx./input/order.xml')
true
doc-available(
   'https://www.datypic.com/functx./input/foo.xml')
false

See Also

fn:docOpens a document based on a URI

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XSLT Services

Recommended Reading:

XQuery