Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XSLT function-available() function


May 28, 2021 XSL T


Table of contents


XSLT function-available() function

The XSLT function-available() function returns a Boolean-type value that is explained in this section.


XSLT function-available() function The complete XSLT function reference object

Definitions and usages

The function-available() function returns a Boolean value that indicates whether the XSLT processor supports the specified function.

You can test XSLT functions and inherited XPath functions.


Grammar

boolean function-available(string)

Parameters

parameter describe
string Required.The function to be tested.

Instance 1

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<xsl:choose>
<xsl:when test="function-available('sum')">
<p>sum() is supported.</p>
</xsl:when>
<xsl:otherwise>
<p>sum() is not supported.</p>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="function-available('current')">
<p>current() is supported.</p>
</xsl:when>
<xsl:otherwise>
<p>current() is not supported.</p>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

XSLT function-available() function The complete XSLT function reference object