XSLT中的數學運算式的整理 (使用的位置為if的判斷為主):

1. a + b==>使用的方式為 <xsl:value-of select="a+b"/>

2. a - b==>使用的方式為 <xsl:value-of select="a-b"/>

3. a * b==>使用的方式為 <xsl:value-of select="a*b"/>

4. a/b==>使用的方式為 <xsl:value-of select="a div b"/>

5. a mod b==>使用的方式為 <xsl:value-of select="a mod b"/>(這是餘數)

6. 需要tree的加總==>使用的方式為 <xsl:value-of select="sum(*)"/>

7. floor(3.2)==>使用的方式為 <xsl:value-of select="floor(3.2)"/> 無條件捨去

8. ceiling(3.2)==>使用的方式為 <xsl:value-of select="ceiling(3.2)"/> 無條件進位

9.round(3.2)==>使用的方式為 <xsl:value-of select="ceiling(3.2)"/> 四捨五入

10.count(*)==>使用的方式為 <xsl:value-of select="count(*)"/> 取得此階有幾筆資料

11.string-length("2.123")==><xsl:value-of select="string-length("2.123")"/>此字串的長度



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 werwolf 的頭像
    werwolf

    等待著真實的自由

    werwolf 發表在 痞客邦 留言(0) 人氣()