Solved

Possible to trim XML data?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 42
read PayflowPro reports using the report metadata using perl 11 40
xml xsd validation free tool to download 10 85
XSL FO - text wrapping and empty spaces 1 32
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

806 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