XSLT function-available() ਫੰਕਸ਼ਨ

ਵਿਆਖਿਆ ਅਤੇ ਵਰਤੋਂ

function-available() ਫੰਕਸ਼ਨ ਇੱਕ ਬੋਲੀਨ ਵਾਲੀ ਕੀਮਤ ਵਾਪਸ ਦਿੰਦਾ ਹੈ ਜੋ ਨਿਸ਼ਚਿਤ ਕਰਦਾ ਹੈ ਕਿ 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() ਸਮਰਥਿਤ ਹੈ.</p>
</xsl:when>
<xsl:otherwise>
<p>sum() ਸਮਰਥਿਤ ਨਹੀਂ ਹੈ.</p>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="function-available('current')">
<p>current() ਸਮਰਥਿਤ ਹੈ.</p>
</xsl:when>
<xsl:otherwise>
<p>current() is not supported.</p>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

查看 XSL 文件查看结果