How can we use xsl:fallback element in XSLT

In this article we are going to explain about xsl:fallback element and his syntax.
  • 1784
The xsl:fallback element is used to handling  XSLT  element that can't handle by the parser, It calls template content that can provide a reasonable substitute to the behavior of the new element when encountered. It is not supported to new version element. It is supported to IE 5.0.

Syntax of xsl::fallback element
 

<xsl:fallback>

  <!--TEMPLATE-->

</xsl:fallback>


It has no attribute.

Example of xsl:fallback element
 

<?xml version="1.0" encoding="ISO-8888-1"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.google.com/XSL/Transform">

  <xsl:template match="Product/pro">

    <xsl:loop select="title">

      <xsl:fallback>

        <xsl:for-each select="title">

          <xsl:value-of select="!"/>

        </xsl:for-each>

      </xsl:fallback>

    </xsl:loop>

  </xsl:template>

</xsl:stylesheet>


Further Readings

You may also want to read these related articles :

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.