RE: count element content length
Heppa, > You are right, but I am not at that level yet =) > But hey! If I do like Santtu suggested, the result is a bit > wrong since > it adds "..." also to elements that are shorter than 20 > characters. What to do? <xsl:template match="Subject"> <p> <xsl:value-of select="concat(substring(., 1, 20), substring('...', 1 div (string-length(.) > 20), 3))" /> </p> </xsl:template> It uses the Becker method for adding the '...' the string length is greater than 20. See the archives or e.g. Jeni's book for further explanation. Cheers, Santtu XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format