XSLT function-available() fonksiyonu
tanım ve kullanım
function-available() fonksiyonu, XSLT işleyicisinin belirlenen 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.
gramer
boolean function-available(string)
parametre
parametre | tanım |
---|---|
string | zorunlu. 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() destekleniyor.</p> </xsl:when> <xsl:otherwise> <p>sum() desteklenmiyor.</p> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="function-available('current')"> <p>current() destekleniyor.</p> </xsl:when> <xsl:otherwise> <p>current() desteklenmiyor.</p> </xsl:otherwise> </xsl:choose> </body> </html> </xsl:template> </xsl:stylesheet>