Xsl substring after a few characters, but do not cut the word

I want to call some substring text, which I add to the desired

<xsl:variable name="substringbreakText">
          <xsl:call-template name="insertBreaks"> 
               <xsl:with-param name="subject" select="substring(PublicProfile/AboutMe,1,550)"/> 
              </xsl:call-template>
    </xsl:variable>

and, like going back to this text, until I get empty space or break. so my task is to return a string of less than 550 characters, but save it with a complication of words

exmple: thats my 550 characters: "The image you see is intended to portray Graham Bourley, Emeritus Professor of Academic Development at the Research Support Unit at UCLA, UK. He asks and conducts writing workshops for graduate students and other scholars.

But what messages does this portrait offer the reader? What is Badley an erudite thinker? What is he looking for the light of truth? What is he leaning to the left? What is he perhaps surprised by such a claim? What is he skeptical of? May be. "As a man, therefore he sees (William Blair).

Eme "

I want to cut space and "Eme" or cut \ r \ n or
in this line.

+3
source share
2 answers
<xsl:value-of select="substring(@Description, 1, 500 + string-length(substring-before(substring(@Description, 501),' ')))" />

it can be changed to full stop or any other way to suit your needs :)

+6
source

If you are in XSLT 1.0, finding the last run before the 550th character will require recursion. Write a template that sets the line:

(a) ( (s, , 1))

(b) ,

(c) (s, 1, (s) -1) .

(, 1, 500), , .

0

All Articles