XSLT and XPath function reference in alphabetical order
(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)
Information on the runtime environment
The function returns the value true or false depending on the availability of the stated schema type.
Obligatory. A xs:string character string in the lexical form of a QName which corresponds in its expanded form to a schema type whose validity shall be tested in the static context. If the string passed on does not correspond to a QName, an error is reported.
Purpose of use:
The type-available() function is able to test the availability of a schema type in the static context of the stylesheet. The schema type is passed on in the form of a QName. For this purpose, the processor must support XML Schema (schema-aware processor). The function also tests the availability of the related constructor function, provided that the tested type is atomic and derived from a primitive type.
However, the function is inappropriate for the test of imported user-defined schema types in connection with the use-when attribute, because schema definitions imported via <xsl:import-schema> are not available at the moment of the evaluation of the static context. For the same reason, the test for availability of a constructor of an imported type with function-available() in use-when would likewise fail.
Remark: The current implementation of the function in Saxon 8.9 tests for availability of the type at runtime, provided that the expression in which the function is called up requires this. The manufacturer declares that this does not expressly allow a conclusion about the availability of the type in the static context.
The function is not available.
type-available($type-name 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