Hi Mike,
Yes, my answer was the brief version, and you are right, is not that simple. In my
experience with formatting Hebrew and Arabic texts, I have found that Antenna House
and XEP handle the Unicode direction and mixing of punctuation quite well *except*
with inline text that mixes direction, particularly when an English phrase or word is
mixed in with a rtl text and there is punctuation at the boundary between directions.
In those cases where the formatter does not automatically get it right, you sometimes
have to force the correct order. The following custom template worked well in those
cases, allowing the author to put the English text and its punctuation inside <phrase
@lang="en"> so the stylesheet could apply the template:
<xsl:template match="phrase[@lang = 'en']">
<fo:bidi-override language="en"
unicode-bidi="embed"
direction="ltr">
<xsl:apply-templates/>
</fo:bidi-override>
</xsl:template>
This template forces whatever is in the phrase element to be formatted ltr, regardless
of the Unicode range.
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net