XSLT function-available() فانکشن
تعریف و استعمال
function-available() فانکشن ایک بولین والی ورتارا برآمد کرتا ہے، جو کہ نشان دہ میگا کے لئے مخصوص فانکشن کو پشتیبندی کیا جاتا ہے یا نہیں。
آپ 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>