Re: [xep-support] character sequence reversed in table body cells for text direction rtl and unicode-bidi normal

From: G. Ken Holman <>
Date: Mon May 17 2010 - 08:22:26 PDT

At 2010-05-17 16:49 +0200, Gerald Wiesinger wrote:
>following situation.
>a table should be shown which can contain text of any language inside its
>table cells.


>since the 1st column should stay the leftmost column we have
>to use the writing mode lr-tb.

Only for the table construct.

>the input data holds alignment information and a 'right' alignment should
>stay a right alignment on the output. so also lr-tb is required.

Or, since you know your own nesting of overrides, you could
selectively choose 'end' or 'start' for right accordingly.

>the main document langauge is known so we can use a a master switch to
>change the text direction accordingly.

Good ... but I don't think you should ever touch the direction= attribute.

>which is rtl for hebrew or arabic

(or Urdu)

>and ltr for any latin character based languae like english, german, french.

(I use this for anything other than HE, AR or UR)

>here the full code for reproducing the error (turn validation off)

Have you considered, instead, something like the following that
avoids using direction= so as not to override the Unicode algorithm
at the character level:

   <block-container writing-mode="{$master-ltr-switch}">
     ... content outside of a table ...
     <block-container writing-mode="lr-tb">
           <block-container writing-mode="{$master-ltr-switch}">
             ... cell content ...
     ... content outside of a table ...

What I've done is I've set the writing mode for the table to be
left-to-write to address your need that the first column is on the
left, but I've restored the writing mode within the cell to the
master writing mode so that nothing is being explicitly set by you
that overrides the Unicode direction of individual characters ...
only FO blocks.

To interpret align="right" you will need to check the
$master-ltr-switch to know if that is 'start' or 'end'.

I hope this helps. I've never had to use direction= in my work as it
does too much. But of course your needs may be different, but it
seems from what I read that you only want to influence the FO
constructs and leave the authored text unaffected.

. . . . . . . . . . . Ken

XSLT/XQuery training:   after 2011-03-28/04-01
Vote for your XML training:
Crane Softwrights Ltd.
G. Ken Holman       
Male Cancer Awareness Nov'07
Legal business disclaimers:
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Mon May 17 08:26:56 2010

This archive was generated by hypermail 2.1.8 : Mon May 17 2010 - 08:26:58 PDT