Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Iterate thru text nodes, finding total string-length, Then trim to only 240 char in total for output Iterate thru text nodes, finding total string-length, Then trim to only 240 char in total for outputTo: NULL Date: 5/6/2005 4:35:00 PM Hello, I have a problem I am trying to solve which I hope someone can help. I have the below xml data. I want to review the combined length and then make sure when I transform the data to a .txt file that only 240char of the combined TextLine data is written to the output. I have found that I can get the total length of the TextLine data with the string-length() function. <xsl:variable name="lengthtest" select="."></xsl:variable> Length is:<xsl:value-of select="string-length($lengthtest)"/> But am having trouble triming the TextLine data to output only 240 char in Total for all Mark Packages. I tried sub-string(var,1,240) but it is only trimming each line_no's text. Can someone help point me in the correct direction? <Mark_Packages> <TextLine line_no="1">Let's see how long this will work with line number one and if I need to see how long this one is to strip off part of the data.</TextLine> <TextLine line_no="2">Then I am on Line #2 now and I want to see what the length is here. I keep typing and this should be a good test</TextLine> <TextLine line_no="3">So then I am</TextLine> <TextLine line_no="4"> on Line 3 and I keep typing, now I will stop.</TextLine> </Mark_Packages> Thanks, Mary | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
