Re: Cutting strings short.

Subject: Re: Cutting strings short.
From: Richard Light <richard@xxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jun 2000 16:17:05 +0100
In message <002901bfe045$e40596c0$9f00643e@xxxxxxxxxx>, M.T. de Brauw
<mark@xxxxxxxxxxx> writes
>I have a collection of XML files in which messages to a messageboard are
>    <title>Title of message. </title>
>    <text>Text of message which should initially be shown partly...</text>
>I would like to output a list of messagetitles and 2 lines of the actual
>message using XSL. Is it possible, using XSL, to cut off a string after say
>75 characters?

<xsl:template match="text">
  <xsl:value-of select="substring(text(), 1, 75)"/>

should do it.

Richard Light
SGML/XML and Museum Information Consultancy

 XSL-List info and archive:

Current Thread