当前位置: 首页 > 网络学院 > XML相关教程 > XSL/XSLT > XSLT <xsl:fallback> 元素

XSL/XSLT
XSL 语言
XSLT 介绍
XSLT 浏览器
XSLT 转换
<xsl:template>
<xsl:value-of>
<xsl:for-each>
<xsl:sort>
<xsl:if>
<xsl:choose>
<xsl:apply-templates>
XSLT - 客户端
XSLT - 服务器端
XSLT - 编辑XML
XSLT 摘要
XSLT 元素参考
XSLT 函数
XSL 编辑器

XSL/XSLT 中的 XSLT <xsl:fallback> 元素


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 229 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The <xsl:fallback> element specifies an alternate code to run if  the XSL processor does not support an XSL element.
<xsl:fallback>元素的作用是:如果XSL处理器不支持XSL元素,那么指定另一个替代原XSL元素运行的代码。


Syntax
语法

<xsl:fallback>
<!-- Content: template -->
</xsl:fallback>

Attributes
属性

None无

Example 1
案例1

This example is supposed to loop through each "title" element with a made up <xsl:loop> element. If the XSL processor does not support this element (which it does not), it will use the <:xsl:for-each> element instead:
下面这个例子使用了<xsl:loop>元素对每个“title[标题]”元素进行循环。如果XSL处理器不支持该元素,那么它将自动使用<: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>

评论 (0) All

登陆 | 还没注册?