当前位置: 首页 > 网络学院 > XML相关教程 > XSL/XSLT > XSLT 函数-available() 函数
XSL/XSLT 中的 XSLT 函数-available() 函数
出处:互联网 整理: 软晨网(RuanChen.com) 发布: 2009-03-04 浏览: 139 ::
The function-available() function returns a Boolean value that indicates whether the function specified is supported by the XSLT processor.
function-available()函数的作用是:返回了一个逻辑值。用于指定XSLT处理器是否允许支持指定的函数。
You may test the XSLT functions and the inherited XPath functions.
你可以对XSLT函数和被继承的XPath函数进行测试。
boolean function-available(string) |
| 参数 | 描述 |
|---|---|
| string | Required. Specifies the function to test 必要参数。指定需要进行测试的函数。 |
<?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> |
评论 (0) All