RE: [xsl] count element content length

Subject: RE: [xsl] count element content length
From: Jarkko.Moilanen@xxxxxx
Date: Tue, 16 Apr 2002 11:25:55 +0300 (EEST)
Hi!

Thank U for this piece of information =)

Jarkko

> 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
> 
> 



*******************************************************************
Jarkko Moilanen         *You are wise, witty, and wonderful,      *
Researcher/ ITCM        *but you spend too much time              *
jarkko.moilanen@xxxxxx  *reading this sort of trash.              *
www.uta.fi/~jm60697     *                                         *
GSM: +358 50 3766 927   *                                         *
*******************************************************************
* ITCM Information Technology and Crisis Management               *
*******************************************************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread