zno2

xslt 简单的语法

1. 循环

    <xsl:for-each select="catalog/cd">
      1
    </xsl:for-each>

 

2. 定义变量赋值使用

      <xsl:variable name="myvariable" select="title"/>
      <xsl:value-of select="$myvariable" />

 

3.  if判断

      <xsl:if test = "1 &lt; 2">
         1
      </xsl:if>

 

4.  为元素设置属性()

<myelement>
  <xsl:attribute name="myattribute">1</xsl:attribute>
</myelement>

 

posted on 2017-10-19 10:03  zno2  阅读(130)  评论(0编辑  收藏  举报

导航