[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: count string-length without white-space and breaki
Hi, thanks David and Vavu. I prefer the solution of David, because it is shorter. Now it put´s the <br /> after 126 characters. How can i test, when after 126 characters comes a white-space to put the <br /> element, to avoid : word10 word11 resulting in wor<br>d10 word11 --------------------------------------------^---------------------- ------ this is character 126 -------^ but i want word10<br>word11 The text-node from memotext is always different, depending on the request. Thanks, Hans Braumüller > > > > <xsl:if test="string-length((../memotext) > 126)"> <br /></xsl:if> > > (../memotext) > 126 > > will take the string value of that element convert it to a number > (probably getting NaN) and then compare with 126 > > so this is probably false > > string-length((../memotext) > 126) > > first converts its argument to a string, "false" and then takes its > length so this is 5 > > using a number in a test attribute it's true if the number isn't zero. > > You have the brackets in the wrong place... > > test="string-length(../memotext) > 126"> > > David > > _____________________________________________________________________ > This message has been checked for all known viruses by Star Internet > delivered through the MessageLabs Virus Scanning Service. For further > information visit http://www.star.net.uk/stats.asp or > alternatively call > Star Internet for details on the Virus Scanning Service. > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > 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
|