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

From: Gerald Wiesinger <Gerald_Wiesinger@at.ibm.com>
Date: Mon May 17 2010 - 08:54:31 PDT

the ' .... cell content .... ' is not text only but created by a editor
application. this is based on the java html editor kit but enhanced.
so the content can contain additional text alignment information which
would get mirrored by the block container writing mode.

one option to solve this would be to modify the editor to mirror the
alignment attributes when reading and writing the editor content.
another option, in combination with the container inside the cell, is to
use a xsl wrapper which translates each left to a right and vice versa.
this would then be required for each source element which can contain a
alignment attribute.

but it simply looked easier to use the direction property as it does not
need the modification of the alignment attributes of the source.
and it really serves the purpose - at least the conclusion after some tests
- but only the body cell content gets reversed character-wise.

(btw.: we also tried the same sample with a container level writing mode
rl-tb and there the cell content text is not reversed.)

____________________________________
Best Regards
Gerald Wiesinger

                                                                           
             "G. Ken Holman"
             <gkholman@CraneSo
             ftwrights.com> To
             Sent by: xep-support@renderx.com
             owner-xep-support cc
             @renderx.com
                                                                   Subject
                                       Re: [xep-support] character
             17.05.2010 17:22 sequence reversed in table body
                                       cells for text direction rtl and
                                       unicode-bidi normal
             Please respond to
             xep-support@rende
                  rx.com
                                                                           
                                                                           
                                                                           

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.

Fine.

>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">
       <table>
         ...
         <table-cell>
           <block-container writing-mode="{$master-ltr-switch}">
             ... cell content ...
           </block-container>
         </table-cell>
         ...
       </table>
     </block-container>
     ... content outside of a table ...
   </block-container>

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 http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/f/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/f/
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/f/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Mon May 17 09:26:56 2010

This archive was generated by hypermail 2.1.8 : Mon May 17 2010 - 09:26:57 PDT