Pages

Showing posts with label check function. Show all posts
Showing posts with label check function. Show all posts

Monday, September 2, 2013

XSLT to check the function supported to xslt or not ??

 XSLT file :
 ---------------------------------------------------

<?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)">       <!--'sum()' function is checking now-->
            <p>Function is supported.</p>
          </xsl:when>
          <xsl:otherwise>
            <p>Function is not supported.</p>
          </xsl:otherwise>
        </xsl:choose>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>


----------------------------------------------------

if o/p is : Function is supported       => means function supported by the xslt