XSLT transformation-split strings by considering nearest whole word RRS feed

  • General discussion

  • I am trying to achieve XSLT transformation with below rules while transforming 'Description' text. I have achieved the straight forward splitting of text into 35 characters strings but could not achieve below adjustments.

    The free text 'Description' will be split among each of the 5 'Description' line text fields.
    At most each field should accept 35 characters.
    Ideally the free text string should be split on the nearest whole word or “,” to prevent a word being split over multiple lines.
    However if the word is greater than 35 characters this will not be possible. The free text 'Description' will be truncated to a total of 175 characters (5*35).
    Based on number of characters after above adjustment, output should be displayed as below

        <Description1>This is First Line Of Text With</Description1>
        <Description2>Large Word Added Here</Description2>

    Please help me.Thanks in advance.

    A. V. Sant

    Tuesday, November 20, 2018 12:58 PM