XSLT function-available() fonksiyonu
Tanım ve Kullanım
function-available() fonksiyonu, XSLT işleyicisinin belirtilen fonksiyonu destekleyip desteklemediğini belirten bir boolean değer döndürür.
XSLT fonksiyonlarını ve miras alınan XPath fonksiyonlarını test edebilirsiniz.
Sözdizimi
boolean function-available(string)
Parametre
Parametre | Açıklama |
---|---|
string | Gerekli. Test edilecek fonksiyonu belirtir. |
Örnek
<?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() desteklenir.</p> </xsl:when> <xsl:otherwise> <p>sum() desteklenmez.</p> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="function-available('current')"> <p>current() desteklenir.</p> </xsl:when> <xsl:otherwise> <p>current() desteklenmiyor.</p> </xsl:otherwise> </xsl:choose> </body> </html> </xsl:template> </xsl:stylesheet>