|
Rank: Member
Joined: 1/28/2015 Posts: 24 Location: Sweden
|
Hello I have a problem in xslt2 where I try to split a text that is 180 characters long into four attributes where each maximum length must be 60 characters. I want to make the split where the last space itself is before 60 characters.
Example: Text before the split :
The earliest known appearance of the phrase is from the Michigan School Moderator , a journal That provided many teachers with education- related news and suggestions for lessons.
The text after the split : Attribut1 The earliest known appearance of the phrase is from the
Attribut2 Michigan School Moderator , a journal That provided many
Attribut3 teachers with education- related news and suggestions for
Attribut4 lessons.
I just cant figure it out...
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Did you try to use the function tokenize-by-length?
|
|
Rank: Member
Joined: 1/28/2015 Posts: 24 Location: Sweden
|
vlad wrote:Did you try to use the function tokenize-by-length?
Hmm, can you please explain how?
|
|
Rank: Member
Joined: 1/28/2015 Posts: 24 Location: Sweden
|
Anyone? Please...
Is there any smart way of using regular expression on this one? Have tried to find something in the "help" file, but could not get it right...
Ok i solved it. Maybe not the prettiest solution, but it works... Edit, new pic... this one works!
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 558
|
Attached are actual example files which demonstrate how to do this using a recursive User-Defined Function (UDF). File Attachment(s): example.zip (4kb) downloaded 191 time(s).
|
|
guest |