|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Line breaks at a special charI need to make a line break if the width exceeds a given value and for that I've added the max-width-attribute to a block. However, I need a little more control to this line break, I need to break at a special character. As an example, look at this:
I have a email and when it exceeds 40 mm, I want to break it at the @ like this foo@ bar.com Is it possible to do with XSLT/XSL-FO or do I need to write an extension (hope not). This is how I want to do <fo:block max-width="40mm" break-char="@"><xsl:value-of select="//email"/></fo:block> :) |
|
|
Re: Line breaks at a special charOn Tue, Aug 19 2008 10:49:06 +0100, niklas@... wrote: > I need to make a line break if the width exceeds a given value and for that > I've added the max-width-attribute to a block. However, I need a little more > control to this line break, I need to break at a special character. As an > example, look at this: > > I have a email and when it exceeds 40 mm, I want to break it at the @ like > this > > foo@ > bar.com > > Is it possible to do with XSLT/XSL-FO or do I need to write an extension > (hope not). This is how I want to do > > <fo:block max-width="40mm" break-char="@"><xsl:value-of > select="//email"/></fo:block> There is no 'break-char' property nor anything similar. You could, however, try , ZERO WIDTH SPACE, after the potential break characters so the line-breaking algorithm has more to work with. Regards, Tony Graham Tony.Graham@... Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2 |
|
|
Re: Line breaks at a special charAh, ok, a good start anyway :) Thanks! All I need now is a "space that is not a space". If I replace all the spaces with this other "space" then the problem is solved. Is there such?
|
|
|
Re: Line breaks at a special charOn Tue, Aug 19 2008 11:21:41 +0100, niklas@... wrote: > Ah, ok, a good start anyway :) Thanks! All I need now is a "space that is not > a space". If I replace all the spaces with this other "space" then the > problem is solved. Is there such? There's more space characters than you can poke a stick at. See pages 205-206 in http://www.unicode.org/versions/Unicode5.0.0/ch06.pdf, available from http://www.unicode.org/versions/Unicode5.1.0/. I would like to think that just ZWS would solve your problem, but you are probably thinking of , NO-BREAK SPACE. ... >> You could, however, try , ZERO WIDTH SPACE, after the potential >> break characters so the line-breaking algorithm has more to work with. Regards, Tony Graham Tony.Graham@... Director W3C XSL FO SG Invited Expert Menteith Consulting Ltd XML, XSL and XSLT consulting, programming and training Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland Registered in Ireland - No. 428599 http://www.menteithconsulting.com -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- xmlroff XSL Formatter http://xmlroff.org xslide Emacs mode http://www.menteith.com/wiki/xslide Unicode: A Primer urn:isbn:0-7645-4625-2 |
| Free embeddable forum powered by Nabble | Forum Help |