XSLT 함수-available() 함수
❮ XSLT 기능 참조정의 및 사용
function-available() 함수는 지정된 함수가 XSLT 프로세서에서 지원되는지 여부를 나타내는 부울 값을 반환합니다.
XSLT 기능과 상속된 XPath 기능을 테스트할 수 있습니다.
통사론
boolean function-available(string)
매개변수
Parameter | Description |
---|---|
string | Required. Specifies the function to test |
실시예 1
<?xml version="1.0" encoding="UTF-8"?>
<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>
❮ XSLT 기능 참조