W3C home > Mailing lists > Public > www-xsl-fo@w3.org > December 2010

RE: keeping word together (not breaking words onto next line)

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Wed, 22 Dec 2010 10:06:47 -0500
Message-Id: <7.0.1.0.2.20101222095707.02495f20@wheresmymailserver.com>
To: <www-xsl-fo@w3.org>
Cc: "Mario Madunic" <Mario_Madunic@newflyer.com>
At 2010-12-21 06:30 -0600, Mario Madunic wrote:
>Seems I forgot to put one twist into the mix. The title is a marker. 
>So did some testing with the xsl:fo source by adding the fo:inline 
>manually and parsing it.
>
><fo:marker marker-class-name="partsPageTitle">FLUSH WINDOW ASSEMBLY, 
>NON-EMERGENCY <fo:inline 
>keep-together.within-line="always">TIP-IN/FIXED</fo:inline></fo:marker>
>
>Works like a charm. So my question is when defining the marker 
>"partsPagetitle" can I place the fo:inline there while creating the 
>xsl:fo or will I need to do a pass on the FO and add the fo:inline 
>during this step.

A marker can contain *any* XSL-FO that the parent of the 
corresponding marker retrieval construct is allowed to have.  Of 
course this cannot be verified until runtime.

>Not a big deal to parse the FO but do not want to go up the wrong 
>path while creating a called-template to parse the string, find any 
>word containing symbols, and then wrap the string in fo:inline.

You can do that word parsing at the time you create the marker and 
then not think of it later.

BTW, I did some hyphenation tests replacing the hyphen with an 
en-dash, but the dash was too long and the word still breaks at the 
"/" so I don't think there is any direction there to follow.

Remember you can use powerful constructs like <xsl:analyze-string> on 
your text nodes in order to more easily find the words that need 
wrapping with an <fo:inline>.

I hope this helps.

. . . . . . . . . . Ken

p.s. Happy Holidays to readers of this list!


--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
Received on Wednesday, 22 December 2010 15:07:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 22 December 2010 15:07:52 GMT