2009-07-27 90 views
2

我嘗試這個算我的title屬性值的總字符,但它似乎沒有評價,因爲我打算:XSLT - Boolean如果屬性值的字符長度大於10

<xsl:if test="count(@title)>10"> 
    <xsl:attribute name="class">double-line</xsl:attribute> 
</xsl:if> 

我也嘗試將/ text()添加到@title。它看起來像我還在。有什麼建議麼?

回答

11

你想要的字符串長度的函數:

<xsl:if test="string-length(@title) &gt; 10"> 
+1

` 「<"` and `">」`應該是XML編碼。 – Tomalak 2009-07-27 17:21:49

2

我相信這是string-length()你在之後。