Solved

Possible to trim XML data?

Posted on 2001-07-26
2
235 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

11 Experts available now in Live!

Get 1:1 Help Now