[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Cutting strings short.
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
|
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
|