Life is Good.

Enhance Tech and English
随笔 - 65, 文章 - 20, 评论 - 21, 引用 - 0
数据加载中……

xsl:with-param 具体用法

 1 <xsl:template name="main">
 2   <xsl:call-template name="child">
 3     <xsl:with-param name="testParam" select="catalog/cd/title" />
 4   </xsl:call-template>
 5 </xsl:template>
 6 
 7 <xsl:template name="child">
 8   <xsl:param name="testParam" />
 9   <table>
10    <tr>
11      <td>
12        <xsl:value-of select="$testParam"/>
13      </td>
14      </tr>
15   </table>
16 </xsl:template>
<xsl:template> 相当于C++ 里面的函数, <xsl:param> 是函数的参数, 这个参数的值(<xsl:with-param name="testParam" select="catalog/cd/title" />)只能在对应的函数(<xsl:template name="child">)里面使用,外面是得不到这个赋值的。

posted on 2009-05-06 20:24 Mike Song 阅读(1235) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理