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
>Hi,
>
>I have a collection of XML files in which messages to a messageboard are
>stored:
>
><message>
>    <title>Title of message. </title>
>    <text>Text of message which should initially be shown partly...</text>
></message>
>
>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)"/>
</xsl:template>

should do it.

Richard Light
SGML/XML and Museum Information Consultancy
richard@xxxxxxxxxxxxxxxxx


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


Current Thread