ហ្វុងហ្វូន function-available() នៃ XSLT
ការអធិប្បាយ និង ការប្រើប្រាស់
ហ្វុងហ្វូន function-available() ត្រូវបានបង្ហាញដោយតួលេខ boolean ដែលបង្ហាញថាតើឧបករណ៍ XSLT គឺជាអ្នកគាំទ្រហ្វុងហ្វូនដែលបានបញ្ជាក់。
អ្នកអាចសាកល្បងហ្វុងហ្វូន XSLT និងហ្វុងហ្វូន XPath ដែលត្រូវបានបន្តពីខាងក្រោយ。
ភាសាបញ្ជាការ
boolean function-available(string)
អត្តបទ
អត្តបទ | ការពន្យល់ |
---|---|
string | ចាំបាច់។ កំណត់នូវហ្វុងហ្វូនត្រូវធ្វើសាកល្បង。 |
ឧទាហរណ៍
<?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>