Solved

Possible to trim XML data?

Posted on 2001-07-26
2
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Checkbox and ListView in Android Layout 4 112
MS Access XML API HTTP POST Call Object Send Not Working Correctly 15 99
Help with Syntax 9 57
ASP and Extracting XML 7 44
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.
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 …
Suggested Courses

739 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