Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Possible to trim XML data?

Posted on 2001-07-26
2
Medium Priority
?
279 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 200 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

879 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