[xep-support] Stretchable no break space

Jirka Kosek jirka at kosek.cz
Wed Sep 15 13:28:31 PDT 2004


David Tolpin wrote:

> There was a customer who complained that  certain authors use
> non-breaking spaces for text-indent, and, according to the 
> specification, they should not collapse.

If it were on 1st April I would though that you must be joking. XML is 
not typewriter. But it is September now. Sigh! I thought that these 
typewriter guys are using MS Word these days. >:-(

> A consequence is that they are not stretched when they text is
> justified. I am not sure it is the right result, but, at least,
> it is simple and consistent. Anything that is not an XML space
> is not a space in XSL FO.

I tried to find some information about this issue in XSL FO spec. Here 
are my conclusions. From the description of the treat-as-word-space 
property it is clear that U+00A0 should be stretched according to 
word-spacing in the same way as the U+0020. This applies to characters 
that are inserted using <fo:character/>. And the description of 
<fo:character/> says that each character in a result tree is treated as 
if it were corresponding <fo:character/>. In this light my 
interpretation of spec is that U+00A0 should stretch.

Of course there might be different interpretations. We can ask XSL-FO WG 
for their opinion about this issue.

> A solution would be to take each sequence of words joined by &#160;s
> into <fo:inline keep-together.within-line="always">V lese</fo:inline>.

Unfortunately this is not suitable solution. It forbids line-breaks 
inside "lese" word (there might be longer words more suitable for 
hyphenation in practice). And also converting from &nbsp; to this format 
is doable in XSLT but very complex if you want to handle cases where 
input document looks like

V&nbsp;<emphasis>lese</emphasis>

and it is processed by several XSLT templates (for text node and for 
emphasis element node). And once you are using xsl:value-of instead 
xsl:apply-templates to pull data from input XML you don't have decent 
chance to surround them by construct you are suggesting.

> If it works for you, use it. If it does not, I need a consistent
> approach, or we'll end up applying the same change back and forth.

If my interperation of XSL-FO is correct I would appreciate fix in XEP. 
If not, would it be possible to add an extension property to switch 
between different modes for U+00A0? Something like 
rx:no-break-space-treatment="{normal|stretch}".

TIA,

					Jirka

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka at kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální školení a poradenství v oblasti technologií XML.
      Podívejte se na náš nově spuštěný web http://DocBook.cz
------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3158 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20040915/15f1e707/attachment.bin>


More information about the Xep-support mailing list