File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Count no. of characters in xsl variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Count no. of characters in xsl variable" Watch "Count no. of characters in xsl variable" New topic
Author

Count no. of characters in xsl variable

Sunetra Saha
Ranch Hand

Joined: Feb 25, 2001
Posts: 77
Hi, can anybody tell me how to count the number of characters in an xslt variable? I need this so that I can truncate a string if its length exceeds a certain number.
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
You can use function string-length($varName)


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Sunetra Saha
Ranch Hand

Joined: Feb 25, 2001
Posts: 77
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Count no. of characters in xsl variable