Edit online

Controlling the Text Direction Using XML Markup

Oxygen XML Editor Eclipse plugin Supports the following CSS properties that control the direction of text:

Table 1. CSS Properties Controlling Text Direction
direction Specifies the writing direction of the text. The possible values are ltr (the text direction is left to right), rtl (the text direction is right to left, and inherit (the direction property is inherited from the parent element).
unicodeBidi Used along with the direction property to create levels of embedded text with different text directions in the same document. The possible values of this property are bidi-override (creates an additional level of embedding and forces all strong characters to the direction specified in the direction), embed (creates an additional level of embedding), normal (does not use an additional level of embedding), and inherit (the value of the unicodeBidi property is inherited from parent element).

For instance, to declare an element as being Right to Left, you could use a stylesheet like this:

XML File:
<article>
  <myRTLpara>RIGHT TO LEFT TEXT</myRTLPara>
</article>
Associated CSS File:
myRTLpara{
    direction:rtl;
    unicode-bidi:embed;
}
Oxygen XML Editor Eclipse plugin recognizes the dir attribute on any XML document. The supported values are:
Values Description
ltr The text from the current element is Left to Right, embedded.
rtl The text from the current element is Right to Left, embedded.
lro The text from the current element is Left to Right, embedded.
rlo The text from the current element is Right to Left, embedded.

The following XML document types make use of the dir attribute with the above values:

  • DITA
  • DocBook
  • TEI
  • XHTML
Note: When the inline element tags are visible, the text in the line is arranged according to the BIDI algorithm after replacing the tags symbols with Object Replacement Characters. This makes it possible to get a different text arrangement when viewing a document in the No Tags mode versus viewing it in the Full Tags mode.