XSLT element-available() ఫంక్షన్

నిర్వచనం మరియు ఉపయోగం

element-available() ఫంక్షన్ ఒక బుల్ విలువను తిరిగి ఇస్తుంది, దానిలో XSLT ప్రాసెసర్ కేంద్రాన్ని నిర్వచించినది మద్దతు అవుతుంది లేదా కాదు.

ఈ ఫంక్షన్ మాత్రమే పెట్టింపు ముఖ్యమైన కేంద్రాలను పరీక్షించడానికి ఉపయోగించబడుతుంది. ఈ కేంద్రాలు ఇంకా ఉన్నాయి:

  • xsl:apply-imports
  • xsl:apply-templates
  • xsl:attributes
  • xsl:call-template
  • xsl:choose
  • xsl:comment
  • xsl:copy
  • xsl:copy-of
  • xsl:element
  • xsl:fallback
  • xsl:for-each
  • xsl:if
  • xsl:message
  • xsl:number
  • xsl:processing instruction
  • xsl:text
  • xsl:value-of
  • xsl:variable

సంకేతం

boolean element-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">

<html>
<body>
<xsl:choose>
<xsl:when test="element-available('xsl:comment')">
<p>xsl:comment సపోర్ట్ ఉంది.</p>
</xsl:when>
<xsl:otherwise>
<p>xsl:comment సపోర్ట్ లేదు.</p>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="element-available('xsl:delete')">
<p>xsl:delete సపోర్ట్ ఉంది.</p>
</xsl:when>
<xsl:otherwise>
<p>xsl:delete సపోర్ట్ లేదు.</p>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

XSL ఫైల్ను చూడండిఫలితాలను చూడండి