# unparsed-text-available

Determines whether the corresponding call on `unparsed-text()` with the same arguments would succeed.

unparsed-text-available($href as xs:string?) → xs:boolean

Arguments
| $href | xs:string? | The uri of the text file to be read
Result | xs:boolean

unparsed-text-available($href as xs:string?, $encoding as xs:string) → xs:boolean

Arguments
| $href | xs:string? | The uri of the text file to be read
| $encoding | xs:string | The encoding to be assumed for the text file
Result | xs:boolean

Links to W3C specifications

Namespace: http://www.w3.org/2005/xpath-functions

Applies to: XPath 2.0, XSLT 2.0, XQuery 1.0 and later versions

XPath 2.0 Specification

XPath 3.0 Specification

Notes on the Saxon implementation

The current Saxon implementation is not stable: if the function is called twice with the same argument, it will read the external file twice, and may return different results if it has changed; the fact that a file is available or unavailable does not guarantee that its status will remain unchanged for the rest of the query or transformation.

>The current implementation is inefficient: if a call on `unparsed-text-available()` is followed by a call on `unparsed-text()` to read the same file, the file will be read twice.

Next