funzione function-available() XSLT
Definizione e uso
La funzione function-available() restituisce un valore booleano che indica se il processore XSLT supporta la funzione specificata.
Puoi testare le funzioni XSLT e le funzioni XPath ereditate.
sintassi
funzione booleana function-available(string)
parametro
parametro | descrizione |
---|---|
string | obbligatorio. Specifica la funzione da testare. |
esempio
<?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() è supportato.</p> </xsl:when> <xsl:otherwise> <p>sum() non è supportato.</p> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="function-available('current')"> <p>current() è supportato.</p> </xsl:when> <xsl:otherwise> <p>current() non è supportato.</p> </xsl:otherwise> </xsl:choose> </body> </html> </xsl:template> </xsl:stylesheet>