XSLT and XPath function reference in alphabetical order
(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)
Association and localisation of nodes and resources at runtime
A Boolean value, true or false.
A string xs:string which has to lexically correspond to a valid xs:anyURI URI string.
Purpose of use:
The fn:doc-available() function tests whether the string passed on to it corresponds to an URI which points at an existing and embeddable resource. Therefore, the function returns the value true only in the event that the URI string points at a document node. If this is not the case, the return value is false.
If a string which cannot be a valid URI string of the xs:anyURI type is passed on to the function, the error »Invalid argument to fn:doc or fn:doc-available« (err:FODC0005) is reported.
Example – prior test of the embedding of an external resource:
The embedding of the external resource only takes place if it exists and can be recorded. This is ensured by fn:doc-available().
The function is not available.
fn:doc-available($uri as xs:string?) as xs:boolean
|<< back||next >>|
Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany