Re: [xsl] keeping text together in PDF

Subject: Re: [xsl] keeping text together in PDF
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jan 2006 10:32:17 -0500
At 2006-01-16 10:11 -0500, Nadia.Swaby@xxxxxx wrote:
I have a problem with an XML Document that is being rendered to PDF, using
AntennaHouse.  The XML contains the following text:
for Sand Castings is .125"

When the document is rendered to PDF, the . (period) gets separated from
the 125".  I discovered that a way around this is to create the fo document
as follows:
<fo:block>
      ....for Sand Castings is <fo:inline keep-together.within-line="always
">.125"</fo:inline>
</fo:block>

Can you show your original stylesheet that produced the separation? There is nothing in XSL-FO 1.0 to imply there is separation between the decimal point and the number.


What I've seen from some students is they inadvertently include significant white-space in their XSLT and misinterpret the results as issues of XSL-FO.

This is what I need to know:  Is there any way (using XSL 1.0) to surround
a string that contains '.n(1-5)" ' with an fo:inline element?

No, not easily. You cannot match on a portion of text, so you would end up with convoluted recursive calls.


Or will I
have to add and element to the XML so that the user can specify which text
need to be kept on the same line?

Hopefully neither and we'll find out the problem in your original stylesheet.


I hope this helps.

. . . . . . . . Ken


-- Upcoming XSLT/XSL-FO hands-on courses: Denver,CO March 13-17,2006 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread