[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Line break algorithm
You could have a look at this -- just add the break at the end of each generated line: https://github.com/dnovatchev/FXSL-XSLT2/blob/master/f/strSplit-to-Lines.xsl This solution was posted in the xsl-list in 2002: https://www.oxygenxml.com/archives/xsl-list/200202/msg01247.html Cheers, Dimitre On Sat, May 2, 2020 at 5:45 PM Rick Quatro rick@xxxxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hi All, > > > > I have lines in my input that I want to add <break> elements to in my > output. For example, this might be the input: > > > > <xsl:param name="line" select="'Takeoff from Unlisted and Alternate > Airports'"/> > > > > and I want to replace a space with a <break> so that each line doesn't > exceed, for example, 35 characters > > > > <line>Takeoff from Unlisted and Alternate<break/>Airports</line> > > > > I am thinking the I can tokenize the line and then recursively build the > string back up from the beginning, checking its length. Any other > suggestions on a general-purpose algorithm that I can use in XSLT 3 would > be appreciated. Thanks in advance. > > > > Rick > > > > Rick Quatro > > Carmen Publishing Inc. > > rick@xxxxxxxxxxxxxxx > > 585-729-6746 > > www.frameexpert.com/store/ > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/782854> (by > email <>) > -- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- Never fight an inanimate object ------------------------------------- To avoid situations in which you might make mistakes may be the biggest mistake of all ------------------------------------ Quality means doing it right when no one is looking. ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play ------------------------------------- To achieve the impossible dream, try going to sleep. ------------------------------------- Facts do not cease to exist because they are ignored. ------------------------------------- Typing monkeys will write all Shakespeare's works in 200yrs.Will they write all patents, too? :) ------------------------------------- Sanity is madness put to good use. ------------------------------------- I finally figured out the only reason to be alive is to enjoy it.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|