Solved

Possible to trim XML data?

Posted on 2001-07-26
2
224 Views
Last Modified: 2006-11-17
hello-

i have a table with several fields in it. one of the fields is defined in my xsl as below:

<td bgcolor="#FFFFFF"><font class="small"><xsl:value-of select="DESCRIPTION" /></font></td>

this description can be up to 1000 chars long. i would like to just display the first 40 chars or so in my table. is this possible to do in xsl? i would rather not modify this field in my business or data layer.

thanks - pipe
0
Comment
Question by:pipe
2 Comments
 
LVL 2

Accepted Solution

by:
djokov earned 50 total points
ID: 6322351
The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345",2) returns "2345".

So:

<td bgcolor="#FFFFFF"><font class="small"><xsl:value-of select="substring(DESCRIPTION,1,40)"/></font></td>


0
 

Author Comment

by:pipe
ID: 6322728
kick butt! thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now