Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XSLT <xsl:fallback> elemens


May 28, 2021 XSL T


Table of contents


XSLT and lt;xsl: fallback and elements

XSLT and xsl:fallback elements can be used to process XSLT elements that cannot be processed by the analyzer


XSLT <xsl:fallback> elemens Complete XSLT element reference manual

Definitions and usages

The element specifies the alternative code that runs when the XSL processor does not support the XSL element.


Grammar

<xsl:fallback>

<!-- Content: template -->

</xsl:fallback>

Property

No

Instance 1

This example would have been intended to loop through each "title" element using a fictitious .lt;xsl:loop.gt; element. If the XSL processor does not support the element (which it does), it will replace it with the element of slt;:xsl:for-each.

<?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="catalog/cd">
<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>

XSLT <xsl:fallback> elemens Complete XSLT element reference manual

Tip: The XSLT and lt;xsl:fallback elements do their function by calling the template content, which provides a reasonable replacement for the behavior of the new element.