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

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:param> 元素


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

Definition and Usage
定义和用法

The <xsl:param> element is used to declare a local or global parameter.
<xsl:param>元素的作用是:声明一个本地参数或通用参数。

Note: The parameter is global if it's declared as a top-level element, and local if it's declared within a template.
注意:如果是以一个顶级参数的形式声明,该参数是一个通用参数;如果是在一个模版中声明,那么它是一个本地参数。


Syntax
语法

<xsl:param
name="name"
select="expression">
<!-- Content:template -->
</xsl:param>

Attributes
属性

属性 描述
name name Required. Specifies the name of the parameter
必要参数。指定参数名称
select expression Optional. Specifies an XPath expression that specifies a default value for the parameter
可选参数。指定XPath表达式,该表达式是用于给一个参数指定默认值的

Example 1
案例1

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="xx"> <html> <body> <xsl:call-template name="show_title"> <xsl:with-param name="title" /> </xsl:call-template> </body> </html>
</xsl:variable>
<xsl:template name="show_title" match="/"> <xsl:param name="title" /> <xsl:for-each select="catalog/cd"> <p>Title: <xsl:value-of select="$title" /></p> </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

评论 (0) All

登陆 | 还没注册?