Reputation: 186662
I attempted this to count the total characters of my title attribute value, but it didn't seem to evaluate as I intended it to:
<xsl:if test="count(@title)>10">
<xsl:attribute name="class">double-line</xsl:attribute>
</xsl:if>
I also tried to append /text() to @title. It looks like I'm still off. Any suggestions?
Upvotes: 2
Views: 16811
Reputation: 9172
You want the string-length function:
<xsl:if test="string-length(@title) > 10">
Upvotes: 11