devxlogo

Compatible Stylesheets with xsl:fallback

Compatible Stylesheets with xsl:fallback

The following code is an example of how to use the xsl:fallback element to achieve full compatibility between XSLT different versions.

Imagine that some future 5.0 version of XSLT implements an element. Processors using earlier versions of XSLT wouldn’t understand that element, so you can include an element to enable the processor to continue, using elements it understands from an earlier version of XSLT.

         XSLT 5.0 - OK - XSLT 5.0                                    XSLT 1.0 - OK - XSLT 1.0                         				          ...

A processor using XSLT 1.0/2.0 will fail to recognize the element, but because it contains an element the older processor will evaluate the test in the element instead of throwing an error.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist